#1359 closed defect (fixed)

tahoe cp --help gives incorrect placement of [options], and [options] is missing in other synopses

Reported by: killyourtv Owned by: davidsarah
Priority: minor Milestone: 1.9.0
Component: code-frontend-cli Version: 1.8.2
Keywords: tahoe-cp help easy Cc:
Launchpad Bug:

Description

tahoe cp --help shows

Usage: tahoe [options] cp FROM.. TO

tahoe --verbose cp returns

tahoe:  option --verbose not recognized

tahoe --help gives the correct information:

Usage:  tahoe <command> [command options]

Attachments (2)

tahoe-cp-help.patch (790 bytes) - added by killyourtv at 2011-02-04T15:01:38Z.
fix placement of [options] in tahoe cp --help
fix-cli-synopses-2.darcs.patch (32.3 KB) - added by davidsarah at 2011-07-24T23:58:28Z.
Fix the help synopses of CLI commands to include [options] in the right place. fixes #1359, fixes #636

Download all attachments as: .zip

Change History (12)

Changed at 2011-02-04T15:01:38Z by killyourtv

fix placement of [options] in tahoe cp --help

comment:1 Changed at 2011-02-04T20:21:36Z by davidsarah

  • Keywords tahoe-cp added; cli cp removed
  • Milestone changed from undecided to 1.9.0
  • Owner set to davidsarah
  • Status changed from new to assigned

Also, most of the other subcommand synopses miss out "[options]" entirely, which is incorrect.

comment:2 Changed at 2011-02-04T20:23:01Z by davidsarah

  • Keywords easy added

comment:3 Changed at 2011-07-24T23:03:01Z by davidsarah

  • Keywords review-needed added
  • Owner davidsarah deleted
  • Status changed from assigned to new

comment:4 Changed at 2011-07-24T23:03:40Z by davidsarah

  • Summary changed from tahoe cp --help gives incorrect placement of [options] to tahoe cp --help gives incorrect placement of [options], and [options] is missing in other synopses

Changed at 2011-07-24T23:58:28Z by davidsarah

Fix the help synopses of CLI commands to include [options] in the right place. fixes #1359, fixes #636

comment:5 Changed at 2011-07-25T00:02:07Z by davidsarah

Updated the patch to also fix #636, and increase the test coverage.

Also the os.path.basename(sys.argv[0]) used to get the command name was evaluating to "trial" when running the test suite, which was fairly harmless but wrong. (I thought about simplifying it just to tahoe, but someone might want differently named scripts for different Tahoe versions, or something like that.)

comment:6 follow-up: Changed at 2011-07-27T20:11:06Z by zooko

  • Keywords reviewed added; review-needed removed
  • Owner set to davidsarah

It looks like in attachment:fix-cli-synopses-2.darcs.patch it does change the command name to a hardcoded tahoe if argv[0] suggests trial. Is that intentional? I don't mind too much either way. Note that there is an "application name" which is produced by the build system and written into src/allmydata/_appname.py, in a similar vein to the way the version number is produced by the build system and written into src/allmydata/_version.py, but there is not currently an executable name that is produced by the build system. One could imagine the build system producing an executable name, such as by writing it into src/allmydata/_execname.py, and then all the places in the code, including this place, which need to use an executable name could refer to that.

(New ticket?)

Other than that, +1 on this patch! Please apply.

comment:7 in reply to: ↑ 6 Changed at 2011-07-28T00:23:39Z by davidsarah

Replying to zooko:

It looks like in attachment:fix-cli-synopses-2.darcs.patch it does change the command name to a hardcoded tahoe if argv[0] suggests trial. Is that intentional?

Yes. The motivation for this change is to make the output of any failed tests less confusing. (I was initially confused when I saw output that said "trial" instead of "tahoe" for the command name.) For that, I think it's sufficient to hardcode the string "tahoe".

comment:8 Changed at 2011-07-28T00:32:40Z by david-sarah@…

  • Resolution set to fixed
  • Status changed from new to closed

In b97837839216d292:

(The changeset message doesn't reference this ticket)

comment:9 Changed at 2011-07-28T00:33:31Z by davidsarah

  • Keywords reviewed removed

comment:10 Changed at 2011-08-01T23:13:51Z by david-sarah@…

In 2da3f69f25645ca6:

Address Kevan's comment in #776 about Options classes missed when adding 'self.command_name'. refs #776, #1359

Note: See TracTickets for help on using tickets.