관리-도구
편집 파일: alias.cpython-36.pyc
3 �ft`� � @ s� d dl mZ d dl mZ d dl mZ d dlZd dlZd dlZd dl Zd dlm Z d dlZd dlZd dl mZ ejd�ZG dd � d e j�ZdS ) � )�absolute_import)�print_function)�unicode_literalsN)�commands)�_�dnfc @ sl e Zd ZdZed�Zedd� �Zdd� Zdd� Z d d � Z dd� Zd d� Zdd� Z dd� Zdd� Zdd� ZdS )�AliasCommand�aliaszList or create command aliasesc C sl | j � }|jdddtd�d� |jdddtd�d� | jdd d dd dgtd �d� | jdddtd�d� d S )Nz--enable-resolvingF� store_truezenable aliases resolving)�default�action�helpz--disable-resolvingzdisable aliases resolving� subcommand�?�list�add�deletezaction to do with aliases)�nargsr �choicesr r �*zcommand[=result]zalias definition)r �metavarr )Zadd_mutually_exclusive_group�add_argumentr )�parserZenable_group� r �/usr/lib/python3.6/alias.py� set_argparser* s zAliasCommand.set_argparserc C sH | j j}| jjdkrd|_tj jj� | _| jj � | jj | _| j� d S )Nr r T)r r ) �cli�demands�optsr Z root_userr �aliasesZAliases�aliases_baseZ _load_aliases�enabledZresolving_enabled�_update_config_from_options)�selfr r r r � configure9 s zAliasCommand.configurec C s� d }| j jrd}tjtd�� | j jr8d}tjtd�� |d k r�tjjt j jj�sft t j jjd�j� t jjjt j jjdd d|i� | jj� s�|| j_d S )NTzAliases are now enabledFzAliases are now disabled�w�mainr! )r Zenable_resolving�logger�infor Zdisable_resolving�os�path�existsr r r ZALIASES_CONF_PATH�open�close�confZ BaseConfigZwrite_raw_configfiler Z_disabled_by_environr! )r# r! r r r r"