code: func (cli *NetworkCli) CmdNetworkLs(chain string, args ...string) error {
  	cmd := cli.Subcmd(chain, "ls", "", "Lists all the networks created by the user", false)
  	quiet := cmd.Bool([]string{"q", "-quiet"}, false, "Only display numeric IDs")
  	noTrunc := cmd.Bool([]string{"#notrunc", "-no-trunc"}, false, "Do not truncate the output")
  	nLatest := cmd.Bool([]string{"l", "-latest"}, false, "Show the latest network created")
  	last := cmd.Int([]string{"n"}, -1, "Show n last created networks")
  	err := cmd.ParseFlags(args, true)
  	if err != nil {
  		return err
  	}
  	obj, _, err := readBody(cli.call("GET", "/networks", nil, nil))
  	if err != nil {
  		return err
  	}
  	if *last == -1 && *nLatest {
  		*last = 1
  	}
  
  	var networkResources []networkResource
  	err = json.Unmarshal(obj, &networkResources)
  	if err != nil {
  		return err
  	}
  
  	wr := tabwriter.NewWriter(cli.out, 20, 1, 3, ' ', 0)
  
  	// unless quiet (-q) is specified, print field titles
  	if !*quiet {
  		fmt.Fprintln(wr, "NETWORK ID\tNAME\tTYPE")
  	}
  
  	for _, networkResource := range networkResources {
  		ID := networkResource.ID
  		netName := networkResource.Name
  		if !*noTrunc {
  			ID = stringid.TruncateID(ID)
  		}
  		if *quiet {
  			fmt.Fprintln(wr, ID)
  			continue
  		}
  		netType := networkResource.Type
  		fmt.Fprintf(wr, "%s\t%s\t%s\t",
  			ID,
  			netName,
  			netType)
  		fmt.Fprint(wr, "\n")
  	}
  	wr.Flush()
  	return nil
  }
docs: // CmdNetworkLs handles Network List UI