Class

QuarrelCommand

Description

class Quarrel.Command : GObject.Object
{
  GHashTable* subcommands,
  QuarrelOpt* opts[],
  gint opts_length1,
  gchar* examples[],
  gint examples_length1,
  QuarrelCommandArg* arg_list[],
  gint arg_list_length1,
  gchar* rest_args_name,
  gchar* rest_args_description
}

Declarative command definition with builder-style APIs for options, arguments, subcommands, parsing, and help generation.

Ancestors

Constructors

quarrel_command_new

Define a new command. Descriptions, arguments, options, subcommands can be added via builder methods.

Functions

quarrel_command_throwing

The current command that threw an error while parsing.

Instance methods

quarrel_command_subcommand

Append a subcommand to this command.

quarrel_command_opt

Append an option to this command.

quarrel_command_about

Set the description of this command.

quarrel_command_arg

Define an optional positional argument.

quarrel_command_required_arg

Define a required positional argument. You might want to use quarrel_command_arg() instead because this method will cause the parser to throw if the argument is missing.

quarrel_command_rest_args

Define the rest of the positional arguments.

quarrel_command_example

Append an example usage of this command.

quarrel_command_get_opt

Get an option appended using quarrel_command_opt() by either its long or short name.

quarrel_command_parse

Parse CLI arguments. Not that the first argument argv[0] is ignored as it is assumed to be the name of this command. Returns the command that should be invoked.

quarrel_command_get_parent
No description available.

quarrel_command_get_about_text
No description available.

quarrel_command_get_args
No description available.

quarrel_command_get_name
No description available.

quarrel_command_set_name
No description available.

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

Quarrel.Command:parent

Parent Command that this Command is a subcommand of.

Quarrel.Command:about-text

Description set via quarrel_command_about().

Quarrel.Command:args

Parsed positional arguments.

Quarrel.Command:name

Name of this command. The name of the top level command should be the name of the program.

Signals

Signals inherited from GObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Class structure

struct QuarrelCommandClass {
  QuarrelCommand* (* parse) (
    QuarrelCommand* self,
    gchar** argv,
    gint argv_length1,
    GError** error
  );
  
}

No description available.

Class members
parse: QuarrelCommand* (* parse) ( QuarrelCommand* self, gchar** argv, gint argv_length1, GError** error )

No description available.

Virtual methods

Quarrel.CommandClass.parse

Parse CLI arguments. Not that the first argument argv[0] is ignored as it is assumed to be the name of this command. Returns the command that should be invoked.