Conversation
57e2bf2 to
e2188af
Compare
karton/core/main.py
Outdated
| subparsers.add_parser("list", help="List active karton binds") | ||
| list_parser = subparsers.add_parser("list", help="List active karton binds") | ||
| list_parser.add_argument( | ||
| "-s", |
There was a problem hiding this comment.
maybe -h for human? Similarly to du, for example
There was a problem hiding this comment.
Makes sense, though in this case it's both more human readable and more machine-readable. The default format looks like this:
This suggests that maybe changing the default output format instead is a better idea (especially since the CLI is intended for humans). But it is obviously a backward incompatible change (assuming someone parses the output for some reason).
For now though: I'm not sure about -h since it's often used for --help. But I don't like --short either, so i've implemented this change. I used --human instead of --human-readable like in du, because in du any prefix of a valid command is accepted, so both will work.
|
Wait, I don't think this works (option |
|
Changed the default instead. The following invocations were tested: The syntax |
karton/core/main.py
Outdated
| level = event.get("levelname") | ||
| name = event.get("name") | ||
| msg = event.get("message") | ||
| print(event) |
| if output_format == "table": | ||
| # Print a human-readable table-like version | ||
| print(f"{'karton name':50} {'version':10} {'karton':10}") | ||
| print("-" * 72) |
There was a problem hiding this comment.
Maybe shutil.get_terminal_size()? We can still set a max width to 72, but maybe we can set shorter padding on narrower terminal?
There was a problem hiding this comment.
Ok, maybe not worth it, 72 characters isn't very wide
------------------------------------------------------------------------
No description provided.