Skip to content

Commit

Permalink
man pages for all new commands + use asciidoc for generation
Browse files Browse the repository at this point in the history
  • Loading branch information
noraj committed Nov 12, 2023
1 parent 7fa9bd7 commit 520d919
Show file tree
Hide file tree
Showing 17 changed files with 1,053 additions and 279 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ group :development, :lint do
end

group :development, :docs do
gem 'asciidoctor', '~> 2.0', '>= 2.0.20' # for manpage generation
gem 'commonmarker', '~> 0.23' # for markdown support in YARD
gem 'ronn', '>= 0.7.3' # for manpage generation
gem 'yard', ['>= 0.9.27', '< 0.10']
end
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ PATH
GEM
remote: https://rubygems.org/
specs:
asciidoctor (2.0.20)
ast (2.4.2)
base64 (0.1.1)
commonmarker (0.23.10)
Expand Down Expand Up @@ -54,6 +55,7 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
asciidoctor (~> 2.0, >= 2.0.20)
bundler (~> 2.1)
commonmarker (~> 0.23)
docopt (~> 0.6)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2020-2022 Alexandre ZANNI (independent)
Copyright (c) 2020-2023 Alexandre ZANNI (independent)
Copyright (c) 2019-2020 Alexandre ZANNI at Orange Cyberdefense

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
18 changes: 10 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

require 'rake/testtask'
require 'bundler/gem_tasks'
require 'asciidoctor'
require_relative 'man/man_inline_macro'

Rake::TestTask.new do |t|
t.libs << 'test'
Expand All @@ -15,12 +17,12 @@ task :count do
puts File.read('data/prototypes.json').scan('"extended"').count
end

# Define a task for creating the man page
desc 'Create the man page'
task :create_manpage do
ronn_source = 'man/haiti.ronn'
manpage_destination = 'man/haiti.1'

# Generate the man page from the ronn file
sh "ronn --roff #{ronn_source} > #{manpage_destination}"
desc 'Create man pages'
task :man do
Asciidoctor::Extensions.register do
inline_macro ManInlineMacro
end
Dir['man/*.adoc'].each do |adoc|
Asciidoctor.convert_file adoc, safe: :safe, backend: 'manpage'
end
end
4 changes: 2 additions & 2 deletions haiti.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Gem::Specification.new do |s|
s.homepage = 'https://noraj.github.io/haiti/'
s.license = 'MIT'

s.files = Dir['bin/*'] + Dir['lib/**/*.rb'] + Dir['data/*.json'] + Dir['man/haiti.1']
s.files += ['LICENSE.txt'] + ['docs/_media/logo.ascii']
s.files = Dir['bin/*', 'lib/**/*.rb', 'data/*.json', 'man/*.1']
s.files += ['LICENSE.txt', 'docs/_media/logo.ascii']
s.bindir = 'bin'
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
s.require_paths = ['lib']
Expand Down
114 changes: 114 additions & 0 deletions man/haiti-fzf.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
'\" t
.\" Title: haiti-fzf
.\" Author: Alexandre ZANNI (@noraj)
.\" Generator: Asciidoctor 2.0.20
.\" Date: 2023-11-12
.\" Manual: haiti-fzf manual
.\" Source: haiti-fzf 2.0.0
.\" Language: English
.\"
.TH "HAITI\-FZF" "1" "2023-11-12" "haiti\-fzf 2.0.0" "haiti\-fzf manual"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
.nh
.ad l
.de URL
\fI\\$2\fP <\\$1>\\$3
..
.als MTO URL
.if \n[.g] \{\
. mso www.tmac
. am URL
. ad l
. .
. am MTO
. ad l
. .
. LINKSTYLE cyan R < >
.\}
.SH "NAME"
haiti-fzf \- Select a Hashcat or John the Ripper reference with fzf from one of the matching hash types
.SH "NOTE"
.sp
Mostly useful for \fBhashcat\-haiti\fP(1) and \fBjohn\-haiti\fP(1) or building another binary or alias that will make use of haiti with fzf input.
.SH "SYNOPSIS"
.sp
\fBhaiti\-fzf\fP hc [\fIoptions\fP] \fI<hash>\fP
.sp
\fBhaiti\-fzf\fP jtr [\fIoptions\fP] \fI<hash>\fP
.sp
\fBhaiti\-fzf\fP \-h | \-\-help
.sp
\fBhaiti\-fzf\fP \-\-version
.SH "OPTIONS"
.sp
\fB\-e, \-\-extended\fP
.RS 4
List all possible hash algorithms including ones using salt
.RE
.sp
\fB\-\-debug\fP
.RS 4
Display arguments
.RE
.sp
\fB\-h, \-\-help\fP
.RS 4
Show this screen
.RE
.sp
\fB\-\-version\fP
.RS 4
Show version
.RE
.SH "COMMANDS"
.sp
\fBhc\fP
.RS 4
Select a Hashcat reference with fzf from one of the matching hash types
.RE
.sp
\fBjtr\fP
.RS 4
Select a John the Ripper reference with fzf from one of the matching hash types
.RE
.SH "PARAMETERS"
.sp
\fB<hash>\fP
.RS 4
Hash string to identify, read from STDIN if equal to "\-"
.RE
.SH "EXAMPLES"
.sp
\fBhaiti\-fzf\fP hc \-e d41d8cd98f00b204e9800998ecf8427e
.sp
\fBhaiti\-fzf\fP jtr d41d8cd98f00b204e9800998ecf8427e
.SH "COPYRIGHT"
.sp
Copyright © 2020\-2023 Alexandre ZANNI (independent)
.sp
Copyright © 2019\-2020 Alexandre ZANNI at Orange Cyberdefense
.sp
This software is distributed under the terms of the MIT License. You may freely
redistribute copies of it, subject to the conditions of the license.
.SH "VERSION"
.sp
2.0.0
.SH "REPORTING BUGS"
.sp
Report bugs to \c
.URL "https://github.com/noraj/haiti/issues" "" "."
.SH "RESOURCES"
.sp
Project homepage and documentation: \c
.URL "https://noraj.github.io/haiti" "" ""
.sp
Source code: \c
.URL "https://github.com/noraj/haiti" "" ""
.SH "SEE ALSO"
.sp
\fBhaiti\fP(1), \fBhashcat\-haiti\fP(1), \fBjohn\-haiti\fP(1), \fBhaiti\-parsable\fP(1)
.SH "AUTHOR"
.sp
Alexandre ZANNI (@noraj)
86 changes: 86 additions & 0 deletions man/haiti-fzf.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
= haiti-fzf(1)
Alexandre ZANNI (@noraj)
:doctype: manpage
:release-version: 2.0.0
:manmanual: haiti-fzf manual
:mansource: haiti-fzf {release-version}
:manversion: {release-version}
:man-linkstyle: pass:[cyan R < >]

== Name

haiti-fzf - Select a Hashcat or John the Ripper reference with fzf from one of the matching hash types

== Note

Mostly useful for man:hashcat-haiti[1] and man:john-haiti[1] or building another binary or alias that will make use of haiti with fzf input.

== Synopsis

*haiti-fzf* hc [_options_] _<hash>_

*haiti-fzf* jtr [_options_] _<hash>_

*haiti-fzf* -h | --help

*haiti-fzf* --version

== Options

*-e, --extended*::
List all possible hash algorithms including ones using salt

*--debug*::
Display arguments

*-h, --help*::
Show this screen

*--version*::
Show version

== Commands

*hc*::
Select a Hashcat reference with fzf from one of the matching hash types

*jtr*::
Select a John the Ripper reference with fzf from one of the matching hash types

== Parameters

*<hash>*::
Hash string to identify, read from STDIN if equal to "-"

== Examples

*haiti-fzf* hc -e d41d8cd98f00b204e9800998ecf8427e

*haiti-fzf* jtr d41d8cd98f00b204e9800998ecf8427e

== Copyright

Copyright © 2020-2023 Alexandre ZANNI (independent)

Copyright © 2019-2020 Alexandre ZANNI at Orange Cyberdefense

This software is distributed under the terms of the MIT License. You may freely
redistribute copies of it, subject to the conditions of the license.

== Version

{release-version}

== Reporting bugs

Report bugs to https://github.com/noraj/haiti/issues.

== Resources

Project homepage and documentation: https://noraj.github.io/haiti

Source code: https://github.com/noraj/haiti

== See also

man:haiti[1], man:hashcat-haiti[1], man:john-haiti[1], man:haiti-parsable[1]
113 changes: 113 additions & 0 deletions man/haiti-parsable.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
'\" t
.\" Title: haiti-parsable
.\" Author: Alexandre ZANNI (@noraj)
.\" Generator: Asciidoctor 2.0.20
.\" Date: 2023-11-12
.\" Manual: haiti-parsable manual
.\" Source: haiti-parsable 2.0.0
.\" Language: English
.\"
.TH "HAITI\-PARSABLE" "1" "2023-11-12" "haiti\-parsable 2.0.0" "haiti\-parsable manual"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
.nh
.ad l
.de URL
\fI\\$2\fP <\\$1>\\$3
..
.als MTO URL
.if \n[.g] \{\
. mso www.tmac
. am URL
. ad l
. .
. am MTO
. ad l
. .
. LINKSTYLE cyan R < >
.\}
.SH "NAME"
haiti-parsable \- Display hash types matching that have a Hashcat reference in an easily parsable format
.SH "NOTE"
.sp
Mostly useful for \fBhaiti\-fzf\fP(1) or building another binary or alias.
.SH "SYNOPSIS"
.sp
\fBhaiti\-parsable\fP hc [\fIoptions\fP] \fI<hash>\fP
.sp
\fBhaiti\-parsable\fP jtr [\fIoptions\fP] \fI<hash>\fP
.sp
\fBhaiti\-parsable\fP \-h | \-\-help
.sp
\fBhaiti\-parsable\fP \-\-version
.SH "OPTIONS"
.sp
\fB\-e, \-\-extended\fP
.RS 4
List all possible hash algorithms including ones using salt
.RE
.sp
\fB\-\-debug\fP
.RS 4
Display arguments
.RE
.sp
\fB\-h, \-\-help\fP
.RS 4
Show this screen
.RE
.sp
\fB\-\-version\fP
.RS 4
Show version
.RE
.SH "COMMANDS"
.sp
\fBhc\fP
.RS 4
Display hash types matching that have a Hashcat reference
.RE
.sp
\fBjtr\fP
.RS 4
Display hash types matching that have a John the Ripper reference
.RE
.SH "PARAMETERS"
.sp
\fB<hash>\fP
.RS 4
Hash string to identify, read from STDIN if equal to "\-"
.RE
.SH "EXAMPLES"
.sp
\fBhaiti\-parsable\fP hc \-e d41d8cd98f00b204e9800998ecf8427e
\fBhaiti\-parsable\fP jtr d41d8cd98f00b204e9800998ecf8427e
.SH "COPYRIGHT"
.sp
Copyright © 2020\-2023 Alexandre ZANNI (independent)
.sp
Copyright © 2019\-2020 Alexandre ZANNI at Orange Cyberdefense
.sp
This software is distributed under the terms of the MIT License. You may freely
redistribute copies of it, subject to the conditions of the license.
.SH "VERSION"
.sp
2.0.0
.SH "REPORTING BUGS"
.sp
Report bugs to \c
.URL "https://github.com/noraj/haiti/issues" "" "."
.SH "RESOURCES"
.sp
Project homepage and documentation: \c
.URL "https://noraj.github.io/haiti" "" ""
.sp
Source code: \c
.URL "https://github.com/noraj/haiti" "" ""
.SH "SEE ALSO"
.sp
\fBhaiti\fP(1), \fBhashcat\-haiti\fP(1), \fBjohn\-haiti\fP(1), \fBhaiti\-fzf\fP(1)
.SH "AUTHOR"
.sp
Alexandre ZANNI (@noraj)
Loading

0 comments on commit 520d919

Please sign in to comment.