1defmodule Charlex.Command do
2 @callback usage() :: [String.t()]
4 @callback description() :: String.t()
6 @callback parse_args(args :: String.t()) :: any()
8 @callback run(context :: Map.t(), args :: [String.t()] | any()) :: String.t() | any()
10 @optional_callbacks usage: 0, description: 0, parse_args: 1
12 defmacro __using__(_opts) do
14 @behaviour unquote(__MODULE__)
17 def usage, do: "This command is without usage, will add it soon"
20 def description, do: "This command is without description, will add it soon"
23 def run(_context, _args), do: :ok
26 def parse_args(args), do: args |> String.split() |> Kernel.tl()
28 defoverridable parse_args: 1, description: 0, run: 2, usage: 0
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list