mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
feat(cli): add display-name option to cli
This commit is contained in:
@@ -35,6 +35,7 @@ import Simplex.Messaging.Parsers (parseAll)
|
||||
import Simplex.Messaging.Protocol (ProtoServerWithAuth, ProtocolTypeI, SMPServerWithAuth, XFTPServerWithAuth)
|
||||
import Simplex.Messaging.Transport.Client (SocksProxyWithAuth (..), SocksAuth (..), defaultSocksProxyWithAuth)
|
||||
import System.FilePath (combine)
|
||||
import Simplex.Chat.Types (ContactName)
|
||||
|
||||
data ChatOpts = ChatOpts
|
||||
{ coreOptions :: CoreChatOpts,
|
||||
@@ -56,6 +57,7 @@ data ChatOpts = ChatOpts
|
||||
data CoreChatOpts = CoreChatOpts
|
||||
{ dbFilePrefix :: String,
|
||||
dbKey :: ScrubbedBytes,
|
||||
displayName :: Maybe ContactName,
|
||||
smpServers :: [SMPServerWithAuth],
|
||||
xftpServers :: [XFTPServerWithAuth],
|
||||
simpleNetCfg :: SimpleNetCfg,
|
||||
@@ -99,6 +101,13 @@ coreChatOptsP appDir defaultDbFileName = do
|
||||
<> help "Database encryption key/pass-phrase"
|
||||
<> value ""
|
||||
)
|
||||
displayName <-
|
||||
optional $
|
||||
strOption
|
||||
( long "display-name"
|
||||
<> metavar "DISPLAY_NAME"
|
||||
<> help "Display name will be sent to your contacts when you connect and only stored on your device and you can change it later."
|
||||
)
|
||||
smpServers <-
|
||||
option
|
||||
parseProtocolServers
|
||||
@@ -244,6 +253,7 @@ coreChatOptsP appDir defaultDbFileName = do
|
||||
CoreChatOpts
|
||||
{ dbFilePrefix,
|
||||
dbKey,
|
||||
displayName,
|
||||
smpServers,
|
||||
xftpServers,
|
||||
simpleNetCfg =
|
||||
|
||||
Reference in New Issue
Block a user