Code Monkey home page Code Monkey logo

Comments (8)

Hixie avatar Hixie commented on June 12, 2024 1

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.

nex3 avatar nex3 commented on June 12, 2024

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.

nex3 avatar nex3 commented on June 12, 2024

I disagree that your help output is less readable because of this, but we could probably add an option to control it.

from args.

Hixie avatar Hixie commented on June 12, 2024

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.

Hixie avatar Hixie commented on June 12, 2024

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.

Hixie avatar Hixie commented on June 12, 2024

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.

snstamml avatar snstamml commented on June 12, 2024

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.

natebosch avatar natebosch commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.