[Cvsshell-devel] CVS: cvsshell/src basic_cmds.py,1.17,1.18 cvs_cmds.py,1.5,1.6
Status: Beta
Brought to you by:
stefanheimann
From: Stefan H. <ste...@us...> - 2002-03-15 18:58:05
|
Update of /cvsroot/cvsshell/cvsshell/src In directory usw-pr-cvs1:/tmp/cvs-serv14646/src Modified Files: basic_cmds.py cvs_cmds.py Log Message: Completed documentation Index: basic_cmds.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/basic_cmds.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** basic_cmds.py 15 Mar 2002 10:37:53 -0000 1.17 --- basic_cmds.py 15 Mar 2002 18:58:00 -0000 1.18 *************** *** 28,33 **** def cmdHelp(app, name, opts): """Print this help message. ! If the name of a command is given as a option, ! a detailed help for this command is printed.""" so = string.split(opts) if len(so) > 0: --- 28,33 ---- def cmdHelp(app, name, opts): """Print this help message. ! If the name of a command is given, a detailed help for this command ! is printed.""" so = string.split(opts) if len(so) > 0: *************** *** 35,45 **** cmd = so[0] doc = app.cmdToDoc[cmd] ! app.printMsg("Command %s:" % cmd) ! app.printMsg(doc) return except KeyError: app.printErr("Unknown command: %s" % cmd) first_sentence = re.compile(r'[^\n]*') ! app.printMsg("The following commands are available:") max_len = 0 for x in app.cmdToCmds.values(): --- 35,45 ---- cmd = so[0] doc = app.cmdToDoc[cmd] ! help = doc ! app.more(help) return except KeyError: app.printErr("Unknown command: %s" % cmd) first_sentence = re.compile(r'[^\n]*') ! help = "The following commands are available:\n\n" max_len = 0 for x in app.cmdToCmds.values(): *************** *** 55,65 **** doc = first_sentence.match(x[1]).group() space = (max_len-len(name)) * ' ' ! app.printMsg("%s%s %s" % (name,space,doc)) ! app.printMsg("All commands not listed here are passed " \ ! "to the underlying shell.") def exitProgram(app, name, opts): ! "Terminate the program." return app.BREAK_REPL --- 55,79 ---- doc = first_sentence.match(x[1]).group() space = (max_len-len(name)) * ' ' ! help += "%s%s %s\n" % (name,space,doc) ! help += """ ! All commands not listed here are passed to the underlying shell. ! You can also use IDs from the current listing as arguments to these commands. ! If the IDs should be embedded into other command options, you can enclose ! them with `[[' and `]]'. ! ! Example: ! rm -f [[1,2]] ! removes the files with ID 1 and 2 ! ! More information on the format of the ID-string is available by typing ! `help list'. ! ! You can get more help for a specific command by typing ! `help <name-of-command>'.""" ! app.more(help) def exitProgram(app, name, opts): ! """Terminate the program.""" return app.BREAK_REPL Index: cvs_cmds.py =================================================================== RCS file: /cvsroot/cvsshell/cvsshell/src/cvs_cmds.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** cvs_cmds.py 15 Mar 2002 00:47:08 -0000 1.5 --- cvs_cmds.py 15 Mar 2002 18:58:00 -0000 1.6 *************** *** 31,37 **** def status(app, name, args): """Display status information on checked out files. ! This command creates a listing with all checked out files and ! their status. The listing can be filtered by setting the variable ! `filter' in the CONFIG section of ~/.cvsshellrc.""" entries = [] regexHead = re.compile(r'File: (?P<name>\S+)\s+Status: (?P<status>.+)') --- 31,39 ---- def status(app, name, args): """Display status information on checked out files. ! This command creates a listing with all checked out files and ! their status. ! ! The listing can be filtered by setting the variable ! `filter' in the CONFIG section of ~/.cvsshellrc.""" entries = [] regexHead = re.compile(r'File: (?P<name>\S+)\s+Status: (?P<status>.+)') *************** *** 77,84 **** def update(app, args, name, simulate=0): """Bring work tree in sync with repository. ! This command donwloads new files and changes to already ! checked out files from the server. It also brings the ! listing in sync with the repository. The listing can be filtered by setting the variable ! `filter' in the CONFIG section of ~/.cvsshellrc.""" try: (globOpts, opts, --- 79,88 ---- def update(app, args, name, simulate=0): """Bring work tree in sync with repository. ! This command donwloads new files and changes to already ! checked out files from the server. It also brings the ! listing in sync with the repository. ! ! The listing can be filtered by setting the variable ! filter' in the CONFIG section of ~/.cvsshellrc.""" try: (globOpts, opts, *************** *** 109,113 **** """Refresh the current listing by simulating an update. This command runs update without really downloading the ! changes. See help on update for details.""" update(app, name, args, simulate=1) --- 113,117 ---- """Refresh the current listing by simulating an update. This command runs update without really downloading the ! changes. See `help update' for details.""" update(app, name, args, simulate=1) *************** *** 120,125 **** if the cvsroot is already set. * the module to checkout. ! You can invoke the command without any arguments, as it prompts ! you for if needed.""" try: (globOpts, opts, --- 124,129 ---- if the cvsroot is already set. * the module to checkout. ! You can invoke the command without any arguments as it prompts ! you if needed.""" try: (globOpts, opts, *************** *** 159,175 **** """Add a new file/directory to the repository. This command accepts two kind of arguments which cannot be intermixed: ! * list of files/directories to add. ! * some ids from the current listing (these are the numbers on the ! left side of the listing). ! The id-argument must have the following format: #, #, #, ... , # ! - where # is either !% or % ! - where % is either a digit or a range of digits ! (written k-n if k,n are digits) ! All numbers given with % are added to the list of ids, ! all numbers given with !% are removed from this list. ! The id-argument is evaluated from left to right. ! Example: ! 3, 4, 7-10, !8, 12-19, !13-18 ! selects the files with the ids 3, 4, 7, 9, 10, 12, 19""" try: (globOpts, opts, --- 163,172 ---- """Add a new file/directory to the repository. This command accepts two kind of arguments which cannot be intermixed: ! * list of files/directories. ! * an ID-string ! More information on the format of the ID-string is available by typing ! `help list'. ! You can invoke the command without any arguments as it prompts ! you if needed.""" try: (globOpts, opts, *************** *** 227,231 **** def addBinary(app, name, args): """Add a new binary file to the repository. ! """ app.printMsg('The file will be added in binary mode.') add(app, name, args, isBinary=1) --- 224,228 ---- def addBinary(app, name, args): """Add a new binary file to the repository. ! See the help section of the add command for more information.""" app.printMsg('The file will be added in binary mode.') add(app, name, args, isBinary=1) *************** *** 234,238 **** def commit(app, name, args): """Check files into the repository. ! """ try: (globOpts, opts, --- 231,241 ---- def commit(app, name, args): """Check files into the repository. ! This command accepts three kind of arguments which cannot be intermixed: ! * list of files/directories. ! * an ID-string ! * an empty argument list: All modified file in the current directory and all ! it's subdirectories are commited. ! More information on the format of the ID-string is available by typing ! `help list'.""" try: (globOpts, opts, *************** *** 279,283 **** def remove(app, name, args): """Remove an entry (some entries) from the repository. ! """ try: (globOpts, opts, --- 282,292 ---- def remove(app, name, args): """Remove an entry (some entries) from the repository. ! This command accepts two kind of arguments which cannot be intermixed: ! * list of files/directories. ! * an ID-string ! More information on the format of the ID-string is available by typing ! `help list'. ! You can invoke the command without any arguments as it prompts ! you if needed.""" try: (globOpts, opts, *************** *** 344,348 **** def printListing(app, name, args): """Print out the current listing. ! """ app.printListing() --- 353,374 ---- def printListing(app, name, args): """Print out the current listing. ! The numbers on the left side of the listing are the IDs of the files. ! Many commands accept an ID-string, that is string that specifies some IDs. ! These IDs are replaced by the corresponding filenames. ! ! The ID-string must have the following format: #, #, #, ... , # ! - where # is either !% or % ! - where % is either a digit or a range of digits ! (written k-n if k,n are digits) ! All numbers given with % are added to the list of ids, ! all numbers given with !% are removed from this list. ! The ID-string is evaluated from left to right. ! ! Example: ! 3, 4, 7-10, !8, 12-19, !13-18 ! selects the files with the ids 3, 4, 7, 9, 10, 12, 19 ! ! The listing can be filtered by setting the variable ! `filter' in the CONFIG section of ~/.cvsshellrc.""" app.printListing() *************** *** 375,379 **** def readCvsRoot(app, name, args): ! """Read the cvsroot variable from the file CVS/Root.""" newRoot = app.readCvsRootFromFile() if newRoot == None: --- 401,405 ---- def readCvsRoot(app, name, args): ! """Read the cvsroot variable from the file ./CVS/Root.""" newRoot = app.readCvsRootFromFile() if newRoot == None: |