Page MenuHomeWrite.as

ensure correct global flag behaviour
Open, Thinking, WishlistPublic

Description

Overview

The global flag set is identical to the post specific flag set. If this is not required we should fix it.

Background

Usage: writeas [global options] command [command options] [arguments...]

I found that we are only ever accessing command options using i.e. c.String, and never the global options i.e. c.GlobalString.

This causes the help output to mislead the user as it claims all the post options are available globally and they are not.

It may be required for the default command to work properly but will need confirmation.

Implementation

Ideally there would be a set of global commands that were sub command agnostic.

The default command should still work as expected, i.e cat myfile.txt | writeas --font mono

Event Timeline

robjloranger created this task.

weird, it doesn't work without the flags all being listed as global. Which feels wrong as we never access global flags directly and the cli library docs do not mention anything about that working this way.

robjloranger changed the task status from Open to Thinking.Jun 11 2019, 11:37 PM
robjloranger lowered the priority of this task from Low to Wishlist.

I reverted the change for now, maybe we can revisit in the future but it might be a limitation of the library.