<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>12205</bug_id>
          
          <creation_ts>2017-10-09 20:57:40 +0000</creation_ts>
          <short_desc>&apos;wic help&apos; / &apos;wic --help&apos; output is not user friendly.  Needs to be redone</short_desc>
          <delta_ts>2020-03-30 02:23:50 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>Scripts and Tools</component>
          <version>2.4</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>4.99</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Scott Rifenbark">srifenbark</reporter>
          <assigned_to name="Chee Yang">chee.yang.lee</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>brian.avery</cc>
    
    <cc>chee.yang.lee</cc>
    
    <cc>ross.burton</cc>
    
    <cc>sgw</cc>
    
    <cc>srifenbark</cc>
    
    <cc>stephano</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>77467</commentid>
    <comment_count>0</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-10-09 20:57:40 +0000</bug_when>
    <thetext>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 &quot;cp&quot; 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).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77468</commentid>
    <comment_count>1</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2017-10-09 21:18:10 +0000</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77469</commentid>
    <comment_count>2</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2017-10-09 21:19:56 +0000</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79531</commentid>
    <comment_count>3</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2018-02-21 17:28:31 +0000</bug_when>
    <thetext>I am finding that there is a bit more help functionality for the &apos;wic list&apos; command.  Currently, the syntax forms for the &apos;wic list&apos; command are as follows:

   SYNOPSIS
       wic list images
       wic list &lt;image&gt; help
       wic list source-plugins

In reality, however, you can do the following:

       wic list images [help]   
       wic list &lt;image_name&gt; help
       wic list source-plugins [help]

The output of wic help list should reflect this SYNOPSIS

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79532</commentid>
    <comment_count>4</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2018-02-21 17:31:37 +0000</bug_when>
    <thetext>Also... those [help] options are pretty useless as you can get the same output with or without them.  

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

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79537</commentid>
    <comment_count>5</comment_count>
    <who name="Amber Elliot">amber.n.elliot</who>
    <bug_when>2018-02-22 02:21:44 +0000</bug_when>
    <thetext>Scott,

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

       wic list &lt;image_name&gt; info
       wic list &lt;source-plugins&gt; info

I&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79563</commentid>
    <comment_count>6</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2018-02-22 18:36:37 +0000</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86858</commentid>
    <comment_count>7</comment_count>
    <who name="Chee Yang">chee.yang.lee</who>
    <bug_when>2020-03-30 02:23:50 +0000</bug_when>
    <thetext>close this bug 
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/scripts/lib/wic?id=621b10f0075bc5d499a2151661c6e1a414f12953</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>