Skip to content

Commit 63f42c0

Browse files
committed
[cli] Update commands intro
1 parent 35e9bcd commit 63f42c0

File tree

2 files changed

+49
-3
lines changed

2 files changed

+49
-3
lines changed

cli/src/Options.hs

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{-# LANGUAGE ApplicativeDo #-}
22
{-# LANGUAGE DerivingStrategies #-}
3+
{-# LANGUAGE QuasiQuotes #-}
34
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
5+
46
{-# HLINT ignore "Avoid lambda" #-}
5-
{-# OPTIONS_GHC -Wno-unused-imports #-}
67

78
module Options
89
( Command (..)
@@ -24,6 +25,7 @@ import Core.Types.MPFS (mpfsClientOption)
2425
import Core.Types.Mnemonics.Options (queryConsole)
2526
import Data.ByteString.Char8 qualified as B
2627
import Data.Functor (($>))
28+
import Data.String.QQ (s)
2729
import Data.Text (Text)
2830
import Data.Text qualified as T
2931
import Data.Text.Encoding qualified as T
@@ -161,11 +163,32 @@ testRunSelectionParser =
161163
optionsParser :: Parser (Box Options)
162164
optionsParser = fmapBox Options <$> commandParser
163165

166+
intro :: String
167+
intro =
168+
[s|
169+
anti - A tool for managing Antithesis test runs on Cardano
170+
171+
This tool is used by all 3 roles in the Cardano to Antithesis interface.
172+
The roles are:
173+
- Requester: Requests test runs on Antithesis
174+
- Agent: Manage test runs on Antithesis
175+
- Oracle: Manages the interface state database (see oracle-anti for an automated oracle process)
176+
177+
Each role has a set of commands that can be used to manage their respective
178+
operations. Use the --help flag to see the available commands and options.
179+
180+
To get bash cli completion use
181+
182+
> source <(anti --bash-completion-script "$(which anti)")
183+
184+
Fish and zsh completions are also available.
185+
|]
186+
164187
parseArgs :: Version -> IO (Box Options)
165188
parseArgs version =
166189
runParser
167190
version
168-
"anti - A tool for managing Antithesis test runs"
191+
intro
169192
optionsParser
170193

171194
retractRequestOptions :: Parser (Box Command)

cli/src/Oracle/Process.hs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ The process
55
- poll the MPFS system to get new requests. (get token)
66
- batches requests and calls MPFS to include them in the token state.
77
-}
8+
{-# LANGUAGE QuasiQuotes #-}
89

910
module Oracle.Process
1011
( ProcessOptions (..)
@@ -23,6 +24,7 @@ import Core.Types.Basic (RequestRefId, TokenId)
2324
import Core.Types.MPFS (MPFSClient (..), mpfsClientOption)
2425
import Core.Types.Wallet (Wallet)
2526
import Data.Functor (void)
27+
import Data.String.QQ (s)
2628
import GitHub (Auth)
2729
import MPFS.API (mpfsClient)
2830
import OptEnvConf
@@ -40,11 +42,32 @@ import Oracle.Validate.Types (AValidationResult (..), Validated (..))
4042
import Paths_anti (version)
4143
import Validation (mkValidation)
4244

45+
intro :: String
46+
intro =
47+
[s|
48+
Cardano Antithesis Oracle Process
49+
50+
This process will run indefinitely, polling the MPFS system for new requests
51+
to include in the oracle token. It will batch requests according to the
52+
maximum number of requests per batch specified, and will include them in
53+
the token state.
54+
55+
To stop the process, simply interrupt it (Ctrl+C).
56+
57+
To get help on the available options, use the --help flag.
58+
59+
To get bash cli completion use
60+
61+
> source <(anti-oracle --bash-completion-script "$(which anti-oracle)")
62+
63+
Fish and zsh completions are also available.
64+
|]
65+
4366
parseArgs :: IO ProcessOptions
4467
parseArgs =
4568
runParser
4669
version
47-
"anithesis-oracle-process - Automated antithesis oracle process"
70+
intro
4871
processOptionsParser
4972

5073
data ProcessOptions = ProcessOptions

0 commit comments

Comments
 (0)