200
200
assert isinstance(arguments, dict)
201
201
cmdargs = options.copy()
202
202
cmdargs.update(arguments)
203
assert self.__doc__ != Command.__doc__, \
204
("No help message set for %r" % self)
203
if self.__doc__ == Command.__doc__:
204
from warnings import warn
205
warn("No help message set for %r" % self)
205
206
self.status = self.run(**cmdargs)
409
410
whether already versioned or not, are searched for files or
410
411
subdirectories that are neither versioned or ignored, and these
411
412
are added. This search proceeds recursively into versioned
413
directories. If no names are given '.' is assumed.
414
Therefore simply saying 'bzr add .' will version all files that
415
Therefore simply saying 'bzr add' will version all files that
415
416
are currently unknown.
417
418
TODO: Perhaps adding a file whose directly is not versioned should
418
419
recursively add that parent, rather than giving an error?
420
takes_args = ['file+']
421
takes_args = ['file*']
421
422
takes_options = ['verbose', 'no-recurse']
423
424
def run(self, file_list, verbose=False, no_recurse=False):
1709
# This is the point where we could hook into argv[0] to determine
1710
# what front-end is supposed to be run
1711
# For now, we are just ignoring it.
1712
cmd_name = argv.pop(0)
1713
1710
for arg in argv[:]:
1714
1711
if arg[:2] != '--': # at the first non-option, we return the rest
1730
1727
This is similar to main(), but without all the trappings for
1731
1728
logging and error handling.
1731
The command-line arguments, without the program name.
1733
Returns a command status or raises an exception.
1733
1735
argv = [a.decode(bzrlib.user_encoding) for a in argv]
1737
# some options like --builtin and --no-plugins have special effects
1738
argv, master_opts = _parse_master_args(argv)
1739
if not master_opts['no-plugins']:
1740
from bzrlib.plugin import load_plugins
1743
args, opts = parse_args(argv)
1745
if master_opts.get('help') or 'help' in opts:
1746
from bzrlib.help import help
1753
if 'version' in opts:
1757
if args and args[0] == 'builtin':
1758
include_plugins=False
1736
# some options like --builtin and --no-plugins have special effects
1737
argv, master_opts = _parse_master_args(argv)
1738
if not master_opts['no-plugins']:
1739
from bzrlib.plugin import load_plugins
1742
args, opts = parse_args(argv)
1744
if master_opts['help']:
1745
from bzrlib.help import help
1753
from bzrlib.help import help
1759
elif 'version' in opts:
1762
elif args and args[0] == 'builtin':
1763
include_plugins=False
1765
1762
cmd = str(args.pop(0))
1766
1763
except IndexError:
1764
print >>sys.stderr, "please try 'bzr help' for help"
1772
1767
plugins_override = not (master_opts['builtin'])
1773
1768
canonical_cmd, cmd_class = get_cmd_class(cmd, plugins_override=plugins_override)