Skip to content

Alias - Console

This guide will guide you how to use the alias command in Fluentix console.


Features

Below are some features packed within the alias command:


Shortcut Creation/Usage

There are two sections, the first is for shortcut creation and the second is for shortcut execution:

I. Shortcut Creation

To create a shortcut, you can type this in cmd/terminal:

Terminal window
flu alias [shortcut] [command]

[shortcut] : The shortcut name.

[command] : The command will be executed when triggered [shortcut].

If you successfully created a shortcut, it will prompt you this:

Terminal window
$ flu alias a version
[SUCCESS] Successfully added command 'clean' with shortcut 'a'!

II. Shortcut usage:

Below is the command you can type in your cmd/terminal to execute a created shortcut.

Terminal window
flu [shortcut]

Below is a reference showing successful call of a shortcut:

Terminal window
$ flu a
[ALIAS] Executing shortcut command 'a'...
...(the functions)...

Shortcut Management

Here are some commands for Shortcut Management:

-manage : Manage created commands

The -manage command will let you manage your created commands, below will show you how to use it:

Terminal window
flu alias -manage

If you have shortcuts created:

Terminal window
$ flu alias -manage
Available commands
[1] [shortcut 1] : [command 1]
[2] [shortcut 2] : [command 2]
[3] [shortcut 3] : [command 3]
...
[n] [shortcut n] : [command n]
[X] Cancel.
Enter your selection:

Now it will wait for your input. The input must be:

  • A number - Will edit the specified command based on the number (must be in the range).

  • X - Closes this prompt.

If you entered a number (must be in the range), then it will prompt you this:

Terminal window
Managing shortcut: a
[S] Edit shortcut's name (current: a)
[C] Edit command (current: clean)
[D] Delete this shortcut.
[A] Apply changes.
[X] Close.
Enter your option:

Now it’s waiting for your input.

Make sure it’s the following input:

  • S - Will edit the shortcut name.
  • C - Will edit the command that shortcut will execute.
  • D - Will delete this shortcut.
  • A - Apply made changes and close safely
  • X - Close this prompt.

-show : Show created commands

The -show command will show created commands, below will show you how you can use it:

Terminal window
flu alias -show

If you have shortcuts created, it will return:

Terminal window
$ flu alias -show
Available shortcuts:
[1] a: flu main.flu
[2] b: clean
...

If you have no shortcuts created, it will return:


Errors

Some errors you might encounter on the usage of the command.

ERROR-ALIAS#1

This error occurs when you run a shortcut but the command ran by the shortcut returns an error.

For example, we have the shortcut a running feff for example:

Terminal window
$ flu alias -show
Available shortcuts:
[1] a: feff

When run flu a, this will occur:

image

ERROR-ALIAS#2

This error occurs when you have no command assigned to the shortcut you’re trying to create.

Below is an example:

Let’s say a is not an existing shortcut.

Terminal window
flu alias a

This will result in this error, ERROR-ALIAS#2:

Terminal window
$ flu alias a
[ERROR-ALIAS#2] No command assigned, try again.
More info at http://docs.fluentix.dev/console/alias#error-alias2

If a is an existing shortcut command, you can execute it by running:

Terminal window
$ flu a
[ALIAS] Executing shortcut command 'a'
...(Execution of command a)...

ERROR-ALIAS#3

This error occurs when the shortcut your trying to assign to already exist with an existing function/shortcut.

For example, you have shortcut a:

Terminal window
$ flu alias -show
Available shortcuts:
[1] a: clean

When you tried creating a new shortcut, it will show the error ERROR-ALIAS#3:

Terminal window
$ flu alias a main.flu
[ERROR-ALIAS#3] 'a' is already used. Try again with a different name.
Or run it by typing 'flu a'
More info at http://docs.fluentix.dev/alias/error3

You can adding a new shortcut with a different name or change that shortcut.

ERROR-ALIAS#4

This error occurs when you are trying to manage/show shortcuts but no shortcut is created.

Terminal window
$ flu alias -show
[ERROR-ALIAS#4] No shortcuts available.
More info at http://docs.fluentix.dev/console/alias#error-alias4

In order to fix this, simply create a shortcut. You can find out how to create a shortcut here.


Extras

This is just some extras useful links (in some cases) that you can optionally check if you wanted.