bin/braid in braid-0.5 vs bin/braid in braid-0.6

- old
+ new

@@ -87,58 +87,63 @@ description <<-TXT Remove a mirror. * removes metadata from .braids * removes the local directory and commits the removal - * does NOT remove the git and git svn remotes in case you still need them around + * removes the git remote by default, --keep can be used to supress that TXT examples <<-TXT . braid remove local/dir TXT - mixin :argument_path, :option_verbose + mixin :argument_path, :option_verbose, :option_keep_remote run { + options = { + :keep => keep + } Braid.verbose = verbose - Braid::Command.run(:remove, path) + Braid::Command.run(:remove, path, options) } } - mode(:setup) { + mode(:diff) { description <<-TXT - Set up git or git-svn remote for a mirror. - All commands that need a remote run setup internally. - - Defaults to setting up remotes for all mirrors if none is specified. + Show diff of local changes to mirror. TXT - examples <<-TXT - . braid setup local/dir + mixin :argument_path, :option_verbose + + run { + Braid::Command.run(:diff, path) + } + } + + mode(:push) { + description <<-TXT + Push local mirror changes to remote. TXT - mixin :optional_path, :option_verbose + mixin :argument_path, :option_verbose run { Braid.verbose = verbose - Braid::Command.run(:setup, path) + Braid::Command.run(:push, path) } } - mode(:diff) { + mode(:setup) { description <<-TXT - Show diff of local changes to mirror. + Set up git and git-svn remotes. TXT - examples <<-TXT - . braid diff local/dir - TXT + mixin :optional_path, :option_verbose - mixin :argument_path, :option_verbose - run { - Braid::Command.run(:diff, path) + Braid.verbose = verbose + Braid::Command.run(:setup, path) } } mode(:version) { description 'Show braid version.' @@ -220,9 +225,17 @@ mixin(:option_verbose) { option(:verbose, :v) { optional desc 'log shell commands' + attr + } + } + + mixin(:option_keep_remote) { + option(:keep) { + optional + desc 'do not remove the remote' attr } } run { help! }