CloudCliCommandRunner class
Represents the Serverpod Cloud CLI main command, its global options, and subcommands.
- Inheritance
-
- Object
- CommandRunner<
void> - CloudCliCommandRunner
Properties
- argParser → ArgParser
-
The top-level argument parser.
no setterinherited
-
commands
→ Map<
String, Command< void> > -
An unmodifiable view of all top-level commands defined for this runner.
no setterinherited
- description → String
-
A short description of this executable.
finalinherited
-
envVariables
→ Map<
String, String> -
The environment variables used for configuration resolution.
finalinherited
- executableName → String
-
The name of the executable being run.
finalinherited
- globalConfiguration ↔ GlobalConfiguration
-
The curremt global configuration for the Serverpod Cloud CLI.
getter/setter pair
-
globalOptions
→ List<
GlobalOption> -
The global option definitions.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- invocation → String
-
A single-line template for how to invoke this executable.
no setterinherited
- logger → CommandLogger
-
final
- messageOutput → MessageOutput?
-
The
MessageOutputfor the command runner. It is also used for the commands unless they have their own.no setterinherited - onAnalyticsEvent → OnAnalyticsEvent?
-
Gets the
onAnalyticsEventcallback, if set.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serviceProvider → CloudCliServiceProvider
-
Gets the initialized service provider for the Serverpod Cloud CLI.
Must not be called before the
runmethod has been invoked.no setter - suggestionDistanceLimit → int
-
The maximum edit distance allowed when suggesting possible intended
commands.
finalinherited
- usage → String
-
Generates a string displaying usage information for the executable.
no setterinherited
-
An optional footer for usage.
no setteroverride
- version → Version
-
final
Methods
-
addCommand(
Command< void> command) → void -
Adds
Commandas a top-level command to this runner.inherited -
addCommands(
List< Command< commands) → voidvoid> > -
Adds a list of commands to the command runner.
inherited
-
analyticsEnabled(
) → bool -
Checks if analytics is enabled.
Note that the return value may change after the
runmethod has started. Can be overridden.inherited -
determineAnalyticsSettings(
) → Future< bool> - Determines the analytics settings based on configuration / settings. Called from run before any analytics events are sent and before any command is run.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parse(
Iterable< String> args) → ArgResults -
Parses the command line arguments and returns the result.
inherited
-
printUsage(
) → void -
Prints the usage information for this runner.
inherited
-
resolveConfiguration(
ArgResults? argResults) → Configuration< GlobalOption> -
Resolves the global configuration for this command runner.
inherited
-
run(
Iterable< String> args) → Future<void> -
Parses
argsand invokesCommand.runon the chosen command.inherited -
runCommand(
ArgResults topLevelResults) → Future< void> -
Runs the command specified by
topLevelResults. -
selectProjectDirectory(
) → String? - Selects a project directory that is either specified by the global configuration, or files found near the current directory. If no project directory is specified nor found then null is returned.
-
sendAnalyticsEvent(
String event) → void -
Sends an analytics event, provided the analytics are enabled.
Invoked from BetterCommandRunner upon command execution
with the event name, or command name if applicable.
Can be overridden to customize the event sending behavior.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
usageException(
String message) → Never -
Throws a
UsageExceptionwithmessage.inherited -
verifiedProjectDirectory(
) → Directory - Selects and verifies the project directory that is either specified by the global configuration, or files found near the current directory.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
create(
{required CommandLogger logger, Version? version, CloudCliServiceProvider? serviceProvider, OnAnalyticsEvent? onAnalyticsEvent, bool? adminUserMode}) → CloudCliCommandRunner