ó ôBQc@sÎddlZddlZddlZddlZddlZddlZddlmZddlmZddlm Z ddlm Z ddlm Z ddlm Z ddlm Z dd lmZdd lmZdd lmZdd lmZdd lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZdZ dZ!defd„ƒYZ"dS(iÿÿÿÿN(tCommand(t COMMAND_NAME(tCOMMAND_NAME_ALIASES(tCONFIG_REQUIRED(t FILE_URIS_OK(tMAX_ARGS(tMIN_ARGS(tPROVIDER_URIS_OK(tSUPPORTED_SUB_ARGS(tURIS_START_ARG(tCommandException(tALL_HELP_TYPES(t HELP_NAME(tHELP_NAME_ALIASES(tHELP_ONE_LINE_SUMMARY(t HelpProvider(t HELP_TEXT(tHelpType(t HELP_TYPE(tMAX_HELP_NAME_LEN(tPIPE(tPopensÒ SYNOPSIS gsutil help [command or topic] DESCRIPTION Running: gsutil help will provide a summary of all commands and additional topics on which help is available. Running: gsutil help command or topic will provide help about the specified command or topic. If you set the PAGER environment variable to the path to a pager program (such as /bin/less on Linux), long help sections will be piped through the specified pager. sFUsage: gsutil [-d][-D] [-h header]... [-m] [command [opts...] args...]t HelpCommandcBs²eZdZi de6ddge6de6de6de6ee 6e e 6de 6e e 6Zide6dge6eje6de6ee6Zd„Zd „Zd Zd „Zd „ZRS( s&Implementation of gsutil help command.thelpt?tmaniits"Get help about commands and topicscCsµ|jƒ\}}g}t|jƒs|jdtƒdttƒd}xIt|tj dd„ƒD]+}|j||j t |j t fƒqiW|jdƒxIt|tj dd„ƒD]+}|j||j t |j t fƒqÂW|jdƒnš|jd }||kr.|jd |ƒnm||jd }|jd ƒ|jd |j t |j t fƒ|jd ƒ|j|j tjdƒƒ|jdj|ƒƒd S(Ns%s Available commands: s %-ss%s tkeycSs |jtS(N(t help_specR (thp((s1/tmp/tmp.yUYbTOKr8o/gsutil/gslib/commands/help.pytrss Additional help topics: cSs |jtS(N(RR (R((s1/tmp/tmp.yUYbTOKr8o/gsutil/gslib/commands/help.pyRwss6 Use gsutil help for detailed help.isNo help available for "%s"s NAME s %s - %s s s R(t _LoadHelpMapstlentargstappendttop_level_usage_stringtstrRtsortedRt COMMAND_HELPRR RtADDITIONAL_HELPRtstript _OutputHelptjoin(tselft help_type_mapt help_name_maptoutputt format_strt help_provtarg((s1/tmp/tmp.yUYbTOKr8o/gsutil/gslib/commands/help.pyt RunCommandks6       cCsútjdd|ƒ}tjdd|ƒ}t|jdƒƒ}dtjkrñ||jƒkrñtjdjdƒ}|djd ƒr™|jd ƒny t |d t ƒj d |ƒWqöt k rí}t d dj|ƒ|fƒ‚qöXn|GHdS(sEOutputs simply formatted string, paginating if long and PAGER definedsssss tPAGERt itlesss-rtstdintinputsUnable to open pager (%s): %sN(tretsubR tsplittostenviront getTermLinestendswithR"RRt communicatetOSErrorR R*(R+R$t num_linestpagerte((s1/tmp/tmp.yUYbTOKr8o/gsutil/gslib/commands/help.pyR)Šs!  icsàyddl‰ddl‰Wntk r3|jSX‡‡fd†}|dƒpg|dƒpg|dƒ}|sµy8tjtjƒtjƒ}||ƒ}tj|ƒWqµqµXn|sÖtj j d|jƒ}nt |ƒS(s Returns number of terminal linesiÿÿÿÿNcs9y*tjdˆj|ˆjdƒƒdSWndSXdS(Nthht1234i(tstructtunpacktioctlt TIOCGWINSZ(tfd(tfcntlttermios(s1/tmp/tmp.yUYbTOKr8o/gsutil/gslib/commands/help.pyt ioctl_GWINSZ§s $iiitLINES( RKRLt ImportErrort_DEFAULT_LINESR;topentctermidtO_RDONLYtcloseR<tgettint(R+RMtiocRJ((RKRLs1/tmp/tmp.yUYbTOKr8o/gsutil/gslib/commands/help.pyR=Ÿs"  $ c Cs˜xatjtjj|jddƒƒD];}tjj|ƒ\}}|dkr%td|ƒq%q%Wxatjtjj|jddƒƒD];}tjj|ƒ\}}|dkr‰td|ƒq‰q‰Wi}i}xtjj D]}g|| [HelpProviders], help name->HelpProvider dict, ).tgslibtcommandss.pysgslib.commands.%staddlhelpsgslib.addlhelp.%s(R;tlistdirtpathR*tgsutil_bin_dirtsplitextt __import__RXt help_providerR t itertoolstchainRt__subclasses__Rt SanityCheckRR R RR"( R+tft module_nametextR,R-tsR0thelp_name_aliases((s1/tmp/tmp.yUYbTOKr8o/gsutil/gslib/commands/help.pyR»s,+ +   (t__name__t __module__t__doc__RRRRRtTrueRtFalseRR Rt command_specR R RR&RRt_detailed_help_textRRR2R)RPR=R(((s1/tmp/tmp.yUYbTOKr8o/gsutil/gslib/commands/help.pyREs,        (#RXRaR;R8RFtsyst gslib.commandRRRRRRRRRR tgslib.exceptionR tgslib.help_providerR R R RRRRRRt subprocessRRRpR#R(((s1/tmp/tmp.yUYbTOKr8o/gsutil/gslib/commands/help.pyts<