cli_util icon indicating copy to clipboard operation
cli_util copied to clipboard

Deprecate cli_util -> ansi

Open kevmoo opened this issue 7 years ago • 2 comments

Trying to standardize on https://github.com/dart-lang/io/blob/master/lib/ansi.dart

kevmoo avatar Mar 28 '18 22:03 kevmoo

Following up on this issue, this package provides a few different services:

String getSdkPath()

This was the original reason why this package was created. The impl. of this method has been dramatically simplified - from 40-50 lines of code down to 1 now:

String getSdkPath() => path.dirname(path.dirname(Platform.resolvedExecutable));

I suspect that we don't need to re-home this method - that we can just mention that people can in-line this into their codebase.

applicationConfigHome

This was added more recently - it exposes some of the XDG_CONFIG_HOME standard. This can be re-homed into a 3rd party package (likely with more XDG_CONFIG_HOME functionality).

class Ansi

A simple ansi class. We would likely deprecate this and point people to package:io (and make sure that there weren't 1-2 methods that should be added to package:io in order to ease any migration to the package).

class Logger, class Progress

Classes that make it easy to write stdout for a cli tool. This includes writing to stdout and stderr, writing to a 'trace' level that user's could optionally enable (via something like a --verbose flag), and an indeterminate progress indicator. There is some coordination between the stdout output and the indeterminate progress output - so writing to stdout doesn't leave garbage characters behind on the cli.

This API is very much presentation focused - it's separate in intent from something like package:logging. This is the biggest question for me - where to host any replacement for this API? Does this match with package:io's intent - would that be a good home for it?

devoncarew avatar Feb 10 '22 19:02 devoncarew

Good thoughts here. I'm happy to slice and dice any way. Just trying to get the number of things we need to maintain...lower 😁

kevmoo avatar Feb 17 '22 01:02 kevmoo