Comments (8)
Is there an option for us to turn it off, or put a newline between every option, or put the default on the end of the previous line? It makes the output less readable for us (see the sample output above). Tools like ls
, dart
, adb
, grep
, and ack
don't do it, so it also makes us look inconsistent with other apps that our users are likely to be using.
from args.
This is intentional. Adding an extra newline after multiline options helps to make them more readable—otherwise their documentation is difficult to visually distinguish from the documentation of the option below.
from args.
I disagree that your help output is less readable because of this, but we could probably add an option to control it.
from args.
Here's an example where it's really ugly. Half the lines have line breaks, the other half doesn't, and as a user I've no idea what's going on. It looks like some are grouped and some aren't but there's no clear indication as to why.
ianh@ianh:~/dev$ flutter run --help
Run your Flutter app on an attached device.
Usage: flutter run [arguments]
-h, --help Print this usage information.
--[no-]checked Toggle Dart's checked mode.
(defaults to on)
--[no-]trace-startup Start tracing during startup.
--route Which route to load when running the app.
-t, --target Target app path / main entry-point file.
(defaults to "lib/main.dart")
--[no-]full-restart Stop any currently running application process before running the app.
(defaults to on)
--[no-]clear-logs Clear log history before running the app.
(defaults to on)
--start-paused Start in a paused mode and wait for a debugger to connect.
--debug-port Listen to the given port for a debug connection.
(defaults to "8181")
--[no-]pub Whether to run "pub get" before executing this command.
(defaults to on)
Run "flutter help" to see global options.
from args.
Another example:
$ flutter analyze --help
Analyze the project's Dart code.
Usage: flutter analyze [arguments]
-h, --help Print this usage information.
--[no-]flutter-repo Include all the examples and tests from the Flutter repository.
--[no-]current-directory Include all the Dart files in the current directory, if any.
(defaults to on)
--[no-]current-package Include the lib/main.dart file from the current directory, if any.
(defaults to on)
--[no-]dartdocs List every public member that is lacking documentation (only examines files in the Flutter repository).
--[no-]preamble Display the number of files that will be analyzed.
(defaults to on)
--[no-]congratulate Show output even when there are no errors, warnings, hints, or lints.
(defaults to on)
--watch Run analysis continuously, watching the filesystem for changes.
--write=<file> Also output the results to a file. This is useful with --watch if you want a file to always contain the latest results.
--[no-]pub Whether to run "pub get" before executing this command.
(defaults to on)
Run "flutter help" to see global options.
I find this very hard to scan.
from args.
Another (combined with some bad line wrapping, see #41, to make this especially egregiously hard to read):
$ flutter create --help
Create a new Flutter project.
If run on a project that already exists, this will repair the project, recreating any files that are m
issing.
Usage: flutter create <output directory>
-h, --help Print this usage information.
--[no-]pub Whether to run "flutter packages get" after the project has been create
d.
(defaults to on)
--[no-]offline When "flutter packages get" is run by the create command, this indicate
s whether to run it in offline mode or not. In offline mode, it will need to have all dependencies alr
eady available in the pub cache to succeed.
--[no-]with-driver-test Also add a flutter_driver dependency and generate a sample 'flutter dri
ve' test.
-t, --template=<type> Specify the type of project to create.
[app] (default) (default) Generate a Flutter application.
[package] Generate a shareable Flutter project containing modular Dart code.
[plugin] Generate a shareable Flutter project containing an API in Dart code
with a platform-specific implementation for Android, for iOS code, or f
or both.
--description The description to use for your new Flutter project. This string ends u
p in the pubspec.yaml file.
(defaults to "A new Flutter project.")
--org The organization responsible for your new Flutter project, in reverse d
omain name notation.
This string is used in Java package names and as prefix in the iOS bund
le identifier.
(defaults to "com.example")
-i, --ios-language [objc (default), swift]
-a, --android-language [java (default), kotlin]
Run "flutter help" to see global options.
I'm especially confused by the line break after --template
before the valid options. It makes it looks like those are unrelated to the option, but that the option is more closely related to --[no-]with-driver-test
before it.
from args.
UX-wise the current behaviour is really bad. In definitely confuses more than it helps, because it suggests groups where there are none.
Either blank lines should be after EACH option (not just after multi-line options), or after NONE.
from args.
I am inclined to remove these newlines.
@Hixie - do you have any concerns if we remove them without an option and publish as a non-breaking change? Any tests that are hardcoded against the output will start to fail.
from args.
Related Issues (20)
- Statically typed argument parser (possibly with code generator)? HOT 3
- Add a CommandRunner example HOT 2
- Why is `CommandRunner._usageWithoutDescription` private?
- Promote Command.argResults to be non-nullable HOT 1
- Make allowed options case insensitive
- How to add default command?
- Provide the function to print strings in nice columns
- Standards used in docopt. HOT 2
- [Feature request] Show command alias in usage HOT 3
- Command CommandRunner Platform.executableArguments HOT 3
- use of 'mandatory' options breaks handling of the help flag
- Feature request: parse complete command string to List<String> args HOT 3
- Analogue of '::' GNU getopt extension? HOT 1
- `--` needs to be escaped on Windows HOT 2
- Usage should be able to show additional info for trailing options (rest) HOT 1
- Setting the mandatory parameter of the addOption function to true has no effect. HOT 2
- `takesArguments` should change the usage text
- Incorrect message in `dart_site --help` HOT 1
- remove nullability from `ArgParser.addFlag({bool? defaultsTo = false})`
- default branch renamed from `master` to `main`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from args.