Bug 12205 - 'wic help' / 'wic --help' output is not user friendly. Needs to be redone
Summary: 'wic help' / 'wic --help' output is not user friendly. Needs to be redone
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: Scripts and Tools (show other bugs)
Version: 2.4
Hardware: x86 Multiple
: Medium normal
Target Milestone: 4.99
Assignee: Chee Yang
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-10-09 20:57 UTC by Scott Rifenbark
Modified: 2020-03-30 02:23 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Rifenbark 2017-10-09 20:57:40 UTC
The Wic help returned to the user is unreadable.  Formatting is non-existent and the amount of information is unnecessary.  

Here are the commands that return help:

  $ wic help
  $ wic --help
  $ wic -h

Wic has 6 commands and 3 topics on which it can return help using the following form:

  $ wic help [COMMAND or TOPIC]

The only command you cannot get help on is the help command.  Thus, the following command returns an error:

  $ wic help help

All other help returned for any COMMAND or TOPIC is formatted very well, is readable, and is informative.  So commands like the following are all good:

  $ wic help create
  $ wic help ls
  $ wic help list

When a user enters general help (wic help), they get a huge listing of unformatted help that spans every facet of the wic command.  All the user really needs is help and usage on the wic command itself.  It is redundant to provide help on individual COMMANDs or TOPICs.  

I propose the following help output for general help:

$ wic help

wic version 0.2.0
       Creates a customized OpenEmbedded image.

       Usage: wic [--version]
              wic help [COMMAND or TOPIC]
              wic COMMAND [ARGS]

          usage 1: Returns the current version of Wic
          usage 2: Returns detailed help for a COMMAND or TOPIC
          usage 3: Executes COMMAND


       COMMAND:

          list   -   List available canned images and source plugins
          ls     -   List contents of partitioned image or partition
          rm     -   Remove files or directories from the vfat or ext*
                     partitions
          help   -   Show help for a wic COMMAND or TOPIC
          write  -   Write an image to a device
          cp     -   Copy files and directories to the vfat or ext*
                     partitions
          create -   Create a new OpenEmbedded image


        TOPIC:

          overview  - Presents an overall overview of Wic
          plugins   - Presents an overview and API for Wic plugins
          kickstart - Presents a Wic kicstart file reference


        Examples:

          $ wic --version

            Returns the current version of Wic


          $ wic help cp

            Returns the SYNOPSIS and DESCRIPTION for the Wic "cp" command.


          $ wic list images

            Returns the list of canned images (i.e. *.wks files located in
            the /scripts/lib/wic/canned-wks directory.


          $ wic create mkefidisk -e core-image-minimal

            Creates an EFI disk image from artifacts used in a previous
            core-image-minimal build in standard BitBake locations
            (e.g. Cooked Mode).
Comment 1 brian avery 2017-10-09 21:18:10 UTC
wic list has more levels.
e.g. this works:
wic list edgerouter help
where edgewrouter is a image (aka wks file)
but this does not
wic list rawcopy help
where rawcopy is a source-plugin
Comment 2 brian avery 2017-10-09 21:19:56 UTC
additionally, 
we need a couple of pattern matchable examples.  For instance, the fact that I look at partition 1 but doing
$ wic ls myImage.wic:1 
is not clear at all, from the help line.
similar for cp and rm
Comment 3 Scott Rifenbark 2018-02-21 17:28:31 UTC
I am finding that there is a bit more help functionality for the 'wic list' command.  Currently, the syntax forms for the 'wic list' command are as follows:

   SYNOPSIS
       wic list images
       wic list <image> help
       wic list source-plugins

In reality, however, you can do the following:

       wic list images [help]   
       wic list <image_name> help
       wic list source-plugins [help]

The output of wic help list should reflect this SYNOPSIS

Scott
Comment 4 Scott Rifenbark 2018-02-21 17:31:37 UTC
Also... those [help] options are pretty useless as you can get the same output with or without them.  

Issuing 'wic list images help' should return a command error.  All that should be allowed is 'wic list images'.  Same for 'wic list source-plugins help'.

Scott
Comment 5 Amber Elliot 2018-02-22 02:21:44 UTC
Scott,

In the patch change that's been submitted, these list commands have been changed from "help", which was misleading, to "info". So, the new usage is:

       wic list <image_name> info
       wic list <source-plugins> info

I'm now out on maternity leave, and I believe that Paul Eggleton will be following up with this in hopes to get this patch merged.
Comment 6 Scott Rifenbark 2018-02-22 18:36:37 UTC
Ok Amber.  I will wait until this is merged so I can play with it and then document it in that section where I tell about the wic command. 

Thanks,
Scott