Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data CmdPart = CmdPart {}
- data Command = Command {}
- data ParsedShell = ParsedShell {
- original :: Text
- parsed :: ParseResult
- presentCommands :: [Command]
- data ShellOpts = ShellOpts {}
- defaultShellOpts :: ShellOpts
- addVars :: [Text] -> ShellOpts -> ShellOpts
- setShell :: Text -> ShellOpts -> ShellOpts
- shellcheck :: ShellOpts -> ParsedShell -> [PositionedComment]
- nonPosixShells :: [Text]
- hasUnsupportedShebang :: Text -> Bool
- parseShell :: Text -> ParsedShell
- findCommandsInResult :: ParseResult -> [Token]
- extractTokensWith :: forall a. (Token -> Maybe a) -> ParseResult -> [a]
- findPipes :: ParsedShell -> [Token]
- hasPipes :: ParsedShell -> Bool
- allCommands :: (Command -> Bool) -> ParsedShell -> Bool
- noCommands :: (Command -> Bool) -> ParsedShell -> Bool
- anyCommands :: (Command -> Bool) -> ParsedShell -> Bool
- findCommandNames :: ParsedShell -> [Text]
- cmdHasArgs :: Text -> [Text] -> Command -> Bool
- cmdsHaveArgs :: [Text] -> [Text] -> Command -> Bool
- cmdHasPrefixArg :: Text -> Text -> Command -> Bool
- extractAllArgs :: Token -> [CmdPart]
- getArgs :: Command -> [Text]
- getAllFlags :: [CmdPart] -> [CmdPart]
- getArgsNoFlags :: Command -> [Text]
- hasFlag :: Text -> Command -> Bool
- hasAnyFlag :: [Text] -> Command -> Bool
- hasArg :: Text -> Command -> Bool
- dropFlagArg :: [Text] -> Command -> Command
- getFlagArg :: Text -> Command -> [Text]
- getValueId :: Int -> [CmdPart] -> Int
- usingProgram :: Text -> ParsedShell -> Bool
- isPipInstall :: Command -> Bool
Documentation
data ParsedShell Source #
ParsedShell | |
|
shellcheck :: ShellOpts -> ParsedShell -> [PositionedComment] Source #
nonPosixShells :: [Text] Source #
hasUnsupportedShebang :: Text -> Bool Source #
parseShell :: Text -> ParsedShell Source #
findCommandsInResult :: ParseResult -> [Token] Source #
extractTokensWith :: forall a. (Token -> Maybe a) -> ParseResult -> [a] Source #
findPipes :: ParsedShell -> [Token] Source #
hasPipes :: ParsedShell -> Bool Source #
allCommands :: (Command -> Bool) -> ParsedShell -> Bool Source #
noCommands :: (Command -> Bool) -> ParsedShell -> Bool Source #
anyCommands :: (Command -> Bool) -> ParsedShell -> Bool Source #
findCommandNames :: ParsedShell -> [Text] Source #
extractAllArgs :: Token -> [CmdPart] Source #
getAllFlags :: [CmdPart] -> [CmdPart] Source #
getArgsNoFlags :: Command -> [Text] Source #
getFlagArg :: Text -> Command -> [Text] Source #
given a flag and a command, return list of arguments for that particulat
flag. E.g., if the command is `useradd -u 12345 luser` and this function is
called for the command u
, it returns ["12345"].
usingProgram :: Text -> ParsedShell -> Bool Source #
Check if a command contains a program call in the Run instruction
isPipInstall :: Command -> Bool Source #