Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Formats the default PathData
.
Synopsis
- data PathDataFormat
- _FormatMultiline :: Prism' PathDataFormat ()
- _FormatTabular :: Prism' PathDataFormat (Coloring, Maybe ColFormat, Maybe ColFormat)
- _FormatSingleline :: Prism' PathDataFormat Coloring
- data ColFormat
- _ColFormatFixed :: Prism' ColFormat Natural
- _ColFormatMax :: Prism' ColFormat ()
- data Coloring
- data Sort
- readSort :: MonadFail m => Text -> m Sort
- sortFn :: Bool -> Sort -> PathData -> PathData -> Ordering
- formatTabularHeader :: Natural -> Natural -> Text
- formatTabularHeaderColor :: Color -> Natural -> Natural -> Text
- formatTabularRow :: Natural -> Natural -> PathData -> Text
- formatTabularRowColor :: Color -> Natural -> Natural -> PathData -> Text
- formatMultiline :: PathData -> Text
- formatSingleline :: PathData -> Text
- formatSinglelineColor :: Color -> PathData -> Text
- sortNameCreated :: PathData -> PathData -> Ordering
- sortSizeName :: PathData -> PathData -> Ordering
- sortReverse :: (a -> b -> Ordering) -> a -> b -> Ordering
- formatFileNameLenMin :: Natural
- formatOriginalPathLenMin :: Natural
- minTableWidth :: Natural
- reservedLineLen :: Natural
Types
data PathDataFormat Source #
Determines how to format a textual PathData
.
FormatMultiline | Formats each file on its own line. |
FormatTabular Coloring (Maybe ColFormat) (Maybe ColFormat) | Formats all fields on the same line. |
FormatSingleline Coloring | Formats each entry on a single line, no table. |
Instances
Show PathDataFormat Source # | |
Defined in Charon.Data.PathData.Formatting showsPrec :: Int -> PathDataFormat -> ShowS # show :: PathDataFormat -> String # showList :: [PathDataFormat] -> ShowS # | |
Eq PathDataFormat Source # | |
Defined in Charon.Data.PathData.Formatting (==) :: PathDataFormat -> PathDataFormat -> Bool # (/=) :: PathDataFormat -> PathDataFormat -> Bool # |
ColFormatFixed Natural | Fixed length format. |
ColFormatMax | Format the column according to its longest entry, if possible. |
_ColFormatMax :: Prism' ColFormat () Source #
Whether we should color list command.
ColoringOn | Coloring on |
ColoringOff | Coloring off |
ColoringDetect | Attempt to detect if the terminal support colors. |
Sort
How to sort the index list.
Format functions
formatMultiline :: PathData -> Text Source #
formatSingleline :: PathData -> Text Source #
Sorting
sortReverse :: (a -> b -> Ordering) -> a -> b -> Ordering Source #
Field lengths
minTableWidth :: Natural Source #
Minimum length needed to display the table.
reservedLineLen :: Natural Source #
For tabular formatting, this is the necessary width for the fixed columns:
type: 9 size: 7 created: 19 separators: 12
NOTE: The separators includes the adjacent whitespace i.e. one separator ' | ' counts for 3, and since we have 4 that makes 12.
This does not include the minimum necessary total space (i.e. minimum 4 for name and 8 for original).