Closed Bug 614130 Opened 14 years ago Closed 14 years ago

distinguish between supported/experimental/internal commands/options and tool/command options

Categories

(Add-on SDK Graveyard :: Documentation, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: myk, Assigned: adw)

References

Details

Attachments

(2 files, 1 obsolete file)

The cfx --help output should distinguish between supported, experimental, and internal commands and options, noting that the experimental and internal commands/options might be changed or removed in the future.

It should also distinguish between options for the cfx tool itself (or all commands generally) and those for individual commands (or subsets thereof), with the former being specifiable only before the command argument, and the latter being specifiable only after it.

(Note: actually enforcing those requirements is non-trivial, but for the purposes of shipping a beta, it is only necessary to make the documentation differentiate between the kinds of options and specify which kind must go where, since the implementation is more lenient than the proposed documentation, and thus we can update the implementation to match the documentation at a later date without breaking documentation-based expectations.)

Finally, it should identify the command argument as a required argument to the tool (currently it identifies it as optional).

Internal Commands and Options:
  commands: sdocs, test* (but not "test")
  options: --e10s, --keydir, --addons, --test-runner-pkg

Experimental Commands and Options:
  commands: develop
  options: --use-server

cfx Tool and General Options:

  -h, --help
  -v, --verbose

Command-specific Options:

  Supported Commands:
    docs

    init

    test
      -g, --use-config
      -a, --app
      -b, --binary
      -p, --profiledir
      --dependencies
      -f, --filter
      --times

      Internal Options:
        --addons
        --keydir
        --test-runner-pkg
        --e10s

    run
      -g, --use-config
      --static-args
      --pkgdir
      --extra-packages
      --templatedir
      -a, --app
      -b, --binary
      -p, --profiledir

      Internal Options:
        --addons
        --keydir
        --e10s

    xpi
      -g, --use-config
      --static-args
      --pkgdir
      --extra-packages
      --templatedir
      --update-url
      --update-link

      Internal Options:
        --keydir

  Experimental Commands:
    develop

  Internal Commands:
    sdocs

    testcfx

    testex
      -g, --use-config
      -a, --app
      -b, --binary
      -p, --profiledir
      --dependencies
      -f, --filter
      --times

      --use-server
      --addons
      --keydir
      --test-runner-pkg

    testpkgs
      -g, --use-config
      -a, --app
      -b, --binary
      -p, --profiledir
      --dependencies
      -f, --filter
      --times

      --use-server
      --addons
      --keydir
      --test-runner-pkg

    testall
      -g, --use-config
      -a, --app
      -b, --binary
      -p, --profiledir
      --dependencies
      -f, --filter
      --times

      --use-server
      --addons
      --keydir
      --test-runner-pkg
These changes also have implications for the cfx Tool reference <https://jetpack.mozillalabs.com/sdk/0.9/docs/#guide/cfx-tool>.
Assignee: nobody → adw
Status: NEW → ASSIGNED
Attached patch patch (obsolete) — Splinter Review
I wanted to output options per command like in comment 0, but it seems optparse can't easily list options more than once.  So this lists commands per option instead.  Each option keeps a list of the commands it supports, which is used to automatically generate the list.  In the future this would also allow `cfx --help run` to list all the options that run supports, for example.

This patch also organizes options using lists so that they can be sorted and displayed alphabetically by name.

I'll attach the output of cfx with this patch so it's easy to look over.
Attachment #493201 - Flags: review?(avarma)
Attachment #493202 - Flags: feedback?(myk)
Comment on attachment 493202 [details]
cfx output with patch applied

Ah, well, this also looks pretty good.
Attachment #493202 - Flags: feedback?(myk) → feedback+
Comment on attachment 493201 [details] [diff] [review]
patch

This patch seems to have bit-rot already, do you think you can rebase it against the current trunk?
Attachment #493201 - Flags: review?(avarma) → review-
Also, Drew, it looks like, as per my comment in bug 614128 comment 7, the --logfile and --profile-memory options will now be under the "Internal Commands and Options" classification, rather than being removed from the SDK entirely.
One semi-quick way of resolving this is to actually just have cfx --help display the raw contents of static-files/md/dev-guide/cfx-tool.md. That may be weird but at least it would get rid of the schism that currently exists between having to duplicate the docs on the Markdown and in the tool itself. Perhaps I am just being a butt, however.
I kind of like that idea since it prevents duplication.  But it does seem like cfx-tool.md will always be a superset of cfx --help, i.e., cfx-tool.md will contain pretty much the same text as cfx --help will, but it might also describe cfx using prose, examples, etc. -- things that aren't really appropriate at the command line.  Maybe instead we could add an item to the release checklist about capturing the output of cfx --help and just copying and pasting it into cfx-tool.md?

Anyhow, I'll work on getting this patch up to date today for the beta.
Aye, true. Though one thing I've noticed about some command-line tools' help systems, e.g. "git help merge", is that they basically just show a man page, which contains all kinds of prose and examples.

I wonder, if we split up the .md file with certain invisible delimiters like the HTML-style comments and formatted them appropriately, we might be able to do something similar, such that 'cfx help' just shows a list of commands and global flags, and doing 'cfx help init' shows the particular section of the Markdown file that explains cfx init. Maybe that is going way too far/complicated though.
Attached patch patch 2Splinter Review
Yeah, I would love for `cfx help` to work like that.  That's a byproduct I had in mind by associating a list of supported commands with each option.  But a full man page for each command and cfx itself would be great.
Attachment #493201 - Attachment is obsolete: true
Attachment #494022 - Flags: review?(avarma)
Comment on attachment 494022 [details] [diff] [review]
patch 2

Cool! I've addressed some minor issues re: what options are compatible with what commands here:

  https://github.com/toolness/jetpack-sdk/commit/9f03c9a596c208d4427b3c312d21f60085e94116

They're all basically nits, though, so feel free to push or fix the nits and push.
Attachment #494022 - Flags: review?(avarma) → review+
Target Milestone: 0.10 → 1.0b1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: