@@ -633,3 +633,131 @@ fn test_init_worktree() -> eyre::Result<()> {
633633
634634 Ok ( ( ) )
635635}
636+
637+ #[ test]
638+ fn test_install_man_pages ( ) -> eyre:: Result < ( ) > {
639+ let git = make_git ( ) ?;
640+ git. init_repo ( ) ?;
641+ let dir = "foo" ;
642+ git. branchless ( "install-man-pages" , & [ dir] ) ?;
643+ let man_page_contents = std:: fs:: read (
644+ git. repo_path
645+ . join ( dir)
646+ . join ( "man1" )
647+ . join ( "git-branchless.1" ) ,
648+ ) ?;
649+ let man_page_contents = String :: from_utf8_lossy ( & man_page_contents) ;
650+ insta:: assert_snapshot!( man_page_contents, @r###"
651+ .ie \n(.g .ds Aq \(aq
652+ .el .ds Aq '
653+ .TH git-branchless 1 "git-branchless 0.7.0"
654+ .SH NAME
655+ git\-branchless \- Branchless workflow for Git
656+ .SH SYNOPSIS
657+ \fBgit\-branchless\fR [\fB\-C \fR] [\fB\-\-color\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] <\fIsubcommands\fR>
658+ .SH DESCRIPTION
659+ Branchless workflow for Git.
660+ .PP
661+ See the documentation at <https://github.com/arxanas/git\-branchless/wiki>.
662+ .SH OPTIONS
663+ .TP
664+ \fB\-C\fR=\fIWORKING_DIRECTORY\fR
665+ Change to the given directory before executing the rest of the program. (The option is called `\-C` for symmetry with Git.)
666+ .TP
667+ \fB\-\-color\fR=\fICOLOR\fR
668+ Flag to force enable or disable terminal colors
669+ .br
670+
671+ .br
672+ \fIPossible values:\fR
673+ .RS 14
674+ .IP \(bu 2
675+ auto: Automatically determine whether to display colors from the terminal and environment variables. This is the default behavior
676+ .IP \(bu 2
677+ always: Always display terminal colors
678+ .IP \(bu 2
679+ never: Never display terminal colors
680+ .RE
681+ .TP
682+ \fB\-h\fR, \fB\-\-help\fR
683+ Print help information (use `\-h` for a summary)
684+ .TP
685+ \fB\-V\fR, \fB\-\-version\fR
686+ Print version information
687+ .SH SUBCOMMANDS
688+ .TP
689+ git\-branchless\-amend(1)
690+ Amend the current HEAD commit
691+ .TP
692+ git\-branchless\-bug\-report(1)
693+ Gather information about recent operations to upload as part of a bug report
694+ .TP
695+ git\-branchless\-gc(1)
696+ Run internal garbage collection
697+ .TP
698+ git\-branchless\-hide(1)
699+ Hide the provided commits from the smartlog
700+ .TP
701+ git\-branchless\-init(1)
702+ Initialize the branchless workflow for this repository
703+ .TP
704+ git\-branchless\-install\-man\-pages(1)
705+ Install git\-branchless\*(Aqs man\-pages to the given path
706+ .TP
707+ git\-branchless\-move(1)
708+ Move a subtree of commits from one location to another
709+ .TP
710+ git\-branchless\-next(1)
711+ Move to a later commit in the current stack
712+ .TP
713+ git\-branchless\-prev(1)
714+ Move to an earlier commit in the current stack
715+ .TP
716+ git\-branchless\-query(1)
717+ Query the commit graph using the "revset" language and print matching commits
718+ .TP
719+ git\-branchless\-repair(1)
720+ Restore internal invariants by reconciling the internal operation log with the state of the Git repository
721+ .TP
722+ git\-branchless\-restack(1)
723+ Fix up commits abandoned by a previous rewrite operation
724+ .TP
725+ git\-branchless\-record(1)
726+ Create a commit by interactively selecting which changes to include
727+ .TP
728+ git\-branchless\-reword(1)
729+ Reword commits
730+ .TP
731+ git\-branchless\-smartlog(1)
732+ `smartlog` command
733+ .TP
734+ git\-branchless\-submit(1)
735+ Push commits to a remote
736+ .TP
737+ git\-branchless\-switch(1)
738+ Switch to the provided branch or commit
739+ .TP
740+ git\-branchless\-sync(1)
741+ Move any local commit stacks on top of the main branch
742+ .TP
743+ git\-branchless\-test(1)
744+ Run a command on each commit in a given set and aggregate the results
745+ .TP
746+ git\-branchless\-undo(1)
747+ Browse or return to a previous state of the repository
748+ .TP
749+ git\-branchless\-unhide(1)
750+ Unhide previously\-hidden commits from the smartlog
751+ .TP
752+ git\-branchless\-wrap(1)
753+ Wrap a Git command inside a branchless transaction
754+ .TP
755+ git\-branchless\-help(1)
756+ Print this message or the help of the given subcommand(s)
757+ .SH VERSION
758+ v0.7.0
759+ .SH AUTHORS
760+ Waleed Khan <me@waleedkhan.name>
761+ "### ) ;
762+ Ok ( ( ) )
763+ }
0 commit comments