Skip to content

Commit

Permalink
rename option
Browse files Browse the repository at this point in the history
  • Loading branch information
joneugster committed Sep 2, 2024
1 parent f57a918 commit e1b5b6d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions ImportGraph/Cli.lean
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def importGraphCLI (args : Cli.Parsed) : IO UInt32 := do
let includeLean := args.hasFlag "include-lean"
let includeStd := args.hasFlag "include-std" || includeLean
let includeDeps := args.hasFlag "include-deps" || includeStd
-- `includeDirectDeps` does not imply `includeDeps`, e.g. `import Lean`.
let includeDirectDeps := args.hasFlag "include-direct-deps"
-- `includeDirect` does not imply `includeDeps`, e.g. `import Lean`.
let includeDirect := args.hasFlag "include-direct"

-- If the flag is set, `directDeps` contains files which are not in the module
-- but directly imported by a file in the module
Expand All @@ -98,7 +98,7 @@ def importGraphCLI (args : Cli.Parsed) : IO UInt32 := do
bif isPrefixOf `Std n then includeStd else
bif isPrefixOf `Lean n || isPrefixOf `Init n then includeLean else
includeDeps
let filterDirect (n : Name) : Bool := includeDirectDeps ∧ directDeps.contains n
let filterDirect (n : Name) : Bool := includeDirect ∧ directDeps.contains n
graph := graph.filterMap (fun n i => if filter n then
(i.filter (fun m => filterDirect m || filter m)) else
-- include direct dep but without any further deps
Expand Down
18 changes: 9 additions & 9 deletions Main.lean
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ def graph : Cmd := `[Cli|
If you are working in a downstream project, use `lake exe graph --to MyProject`."

FLAGS:
"show-transitive"; "Show transitively redundant edges."
to : ModuleName; "Only show the upstream imports of the specified module."
"from" : ModuleName; "Only show the downstream dependencies of the specified module."
"exclude-meta"; "Exclude any files starting with `Mathlib.[Tactic|Lean|Util|Mathport]`."
"include-direct-deps"; "Include directly imported files from other libraries"
"include-deps"; "Include used files from other libraries (not including Lean itself and `std`)"
"include-std"; "Include used files from the Lean standard library (implies `--include-deps`)"
"include-lean"; "Include used files from Lean itself (implies `--include-deps` and `--include-std`)"
"mark-module"; "Visually highlight the current module (used in combination with some `--include-XXX`)."
"show-transitive"; "Show transitively redundant edges."
to : ModuleName; "Only show the upstream imports of the specified module."
"from" : ModuleName; "Only show the downstream dependencies of the specified module."
"exclude-meta"; "Exclude any files starting with `Mathlib.[Tactic|Lean|Util|Mathport]`."
"include-direct"; "Include directly imported files from other libraries"
"include-deps"; "Include used files from other libraries (not including Lean itself and `std`)"
"include-std"; "Include used files from the Lean standard library (implies `--include-deps`)"
"include-lean"; "Include used files from Lean itself (implies `--include-deps` and `--include-std`)"
"mark-module"; "Visually highlight the current module (used in combination with some `--include-XXX`)."

ARGS:
...outputs : String; "Filename(s) for the output. \
Expand Down

0 comments on commit e1b5b6d

Please sign in to comment.