cmd_plus library

Classes

AnsiCode
Standard ANSI escape code for customizing terminal text output.
AnsiCodeType
The type of code represented by AnsiCode.
CmdPlus
CmdPlus is a class that provides a simple methods to run processes on the command line. It is a wrapper around the Process class, making it easier to log errors and process results with package:mason_logger.
CmdPlusMode
The mode in which to run the process.
CmdPlusResult
CmdPlusResult is a class representing a result of command execution with CmdPlus
DirectoryFilter
Filters that can be applied when copying or manipulating directories
ExitCode
Exit code constants.
FileFilter
Filters that can be applied when copying or manipulating files
IgnorePathsDirectoryFilter
Logger
A basic Logger which wraps stdio and applies various styles.
LogTheme
A theme object which contains styles for all log message types.
ProcessManager
A high-level abstraction around using and managing processes on the system.
Progress
A class that can be used to display progress information to the user.
ProgressAnimation
An object which contains configuration for the animation of a Progress instance.
ProgressOptions
An object containing configuration for a Progress instance.
ReplaceInFileContentDirectoryFilter
ReplaceInFileContentFilter
ReplaceInFileNamesDirectoryFilter
ReplaceInFolderNamesDirectoryFilter
SharedStdIn
A singleton wrapper around stdin that allows new subscribers.
Spawn
A process instance created and managed through ProcessManager.

Enums

Level
Indicates the desired logging level.

Extensions

DirectoryExtensions on Directory
Extension methods for making interactions with Directorys easier.
FileExtensions on File
Extension methods for making interactions with Files easier.

Constants

backgroundBlack → const AnsiCode
backgroundBlue → const AnsiCode
backgroundColors → const List<AnsiCode>
All of the AnsiCode values that represent AnsiCodeType.background.
backgroundCyan → const AnsiCode
backgroundDarkGray → const AnsiCode
backgroundDefault → const AnsiCode
backgroundGreen → const AnsiCode
backgroundLightBlue → const AnsiCode
backgroundLightCyan → const AnsiCode
backgroundLightGray → const AnsiCode
backgroundLightGreen → const AnsiCode
backgroundLightMagenta → const AnsiCode
backgroundLightRed → const AnsiCode
backgroundLightYellow → const AnsiCode
backgroundMagenta → const AnsiCode
backgroundRed → const AnsiCode
backgroundWhite → const AnsiCode
backgroundYellow → const AnsiCode
black → const AnsiCode
blue → const AnsiCode
cyan → const AnsiCode
darkGray → const AnsiCode
defaultForeground → const AnsiCode
foregroundColors → const List<AnsiCode>
All of the AnsiCode values that represent AnsiCodeType.foreground.
green → const AnsiCode
lightBlue → const AnsiCode
lightCyan → const AnsiCode
lightGray → const AnsiCode
lightGreen → const AnsiCode
lightMagenta → const AnsiCode
lightRed → const AnsiCode
lightYellow → const AnsiCode
magenta → const AnsiCode
red → const AnsiCode
resetAll → const AnsiCode
resetBold → const AnsiCode
resetDim → const AnsiCode
resetItalic → const AnsiCode
resetReverse → const AnsiCode
resetUnderlined → const AnsiCode
styleBold → const AnsiCode
styleDim → const AnsiCode
styleItalic → const AnsiCode
styleReverse → const AnsiCode
styles → const List<AnsiCode>
All of the AnsiCode values that represent AnsiCodeType.style.
styleUnderlined → const AnsiCode
white → const AnsiCode
yellow → const AnsiCode

Properties

ansiOutputEnabled bool
Whether formatted ANSI output is enabled for wrapWith and AnsiCode.wrap.
no setter
sharedStdIn SharedStdIn
A shared singleton instance of dart:io's stdin stream.
final

Functions

copyPath(String from, String to) Future<void>
Copies all of the files in the from directory to to.
copyPathSync(String from, String to) → void
Copies all of the files in the from directory to to.
isExecutable(String path, {bool? isWindows, FutureOr<FileStat> getStat(String path) = FileStat.stat}) FutureOr<bool>
Returns whether path is considered an executable file on this OS.
Wraps uri with an escape sequence so it's recognized as a hyperlink. An optional message can be used in place of the uri. If no message is provided, the text content will be the full uri.
overrideAnsiOutput<T>(bool enableAnsiOutput, T body()) → T
Allows overriding ansiOutputEnabled to enableAnsiOutput for the code run within body.
shellSplit(String command) List<String>
Splits command into tokens according to the POSIX shell specification.

Typedefs

LogStyle = String? Function(String? message)
Type definition for a function which accepts a log message and returns a styled version of that message.
StartProcess = Future<Process> Function(String executable, List<String> arguments, {Map<String, String> environment, bool includeParentEnvironment, ProcessStartMode mode, bool runInShell, String workingDirectory})
Type definition for both io.Process.start and ProcessManager.spawn.