2019-04-03 04:27:37 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
__package__ = 'archivebox.cli'
|
|
|
|
__command__ = 'archivebox help'
|
|
|
|
__description__ = 'Print the ArchiveBox help message and usage'
|
|
|
|
|
|
|
|
import sys
|
|
|
|
import argparse
|
|
|
|
|
|
|
|
from ..legacy.util import reject_stdin
|
2019-04-11 10:59:14 +00:00
|
|
|
from ..legacy.config import ANSI
|
2019-04-03 04:27:37 +00:00
|
|
|
from . import list_subcommands
|
|
|
|
|
|
|
|
|
|
|
|
def main(args=None):
|
|
|
|
args = sys.argv[1:] if args is None else args
|
|
|
|
|
|
|
|
parser = argparse.ArgumentParser(
|
|
|
|
prog=__command__,
|
|
|
|
description=__description__,
|
|
|
|
add_help=True,
|
|
|
|
)
|
|
|
|
parser.parse_args(args)
|
|
|
|
reject_stdin(__command__)
|
|
|
|
|
|
|
|
|
|
|
|
COMMANDS_HELP_TEXT = '\n '.join(
|
|
|
|
f'{cmd.ljust(20)} {summary}'
|
|
|
|
for cmd, summary in list_subcommands().items()
|
|
|
|
)
|
|
|
|
|
2019-04-11 10:59:14 +00:00
|
|
|
print('''{green}ArchiveBox: The self-hosted internet archive.{reset}
|
|
|
|
|
|
|
|
{lightblue}Usage:{reset}
|
2019-04-03 04:27:37 +00:00
|
|
|
archivebox [command] [--help] [--version] [...args]
|
|
|
|
|
2019-04-11 10:59:14 +00:00
|
|
|
{lightblue}Comamnds:{reset}
|
|
|
|
{}
|
2019-04-03 04:27:37 +00:00
|
|
|
|
2019-04-11 10:59:14 +00:00
|
|
|
{lightblue}Example Use:{reset}
|
2019-04-03 04:27:37 +00:00
|
|
|
mkdir my-archive; cd my-archive/
|
|
|
|
archivebox init
|
2019-04-22 18:42:04 +00:00
|
|
|
archivebox info
|
2019-04-03 04:27:37 +00:00
|
|
|
|
2019-04-03 07:52:56 +00:00
|
|
|
archivebox add https://example.com/some/page
|
2019-04-03 04:27:37 +00:00
|
|
|
archivebox add --depth=1 ~/Downloads/bookmarks_export.html
|
2019-04-03 07:52:56 +00:00
|
|
|
|
|
|
|
archivebox list --sort=timestamp --csv=timestamp,url,is_archived
|
2019-04-22 18:42:04 +00:00
|
|
|
archivebox schedule --every=week https://example.com/some/feed.rss
|
|
|
|
archivebox update --resume=15109948213.123
|
2019-04-03 04:27:37 +00:00
|
|
|
|
2019-04-11 10:59:14 +00:00
|
|
|
{lightblue}Documentation:{reset}
|
2019-04-03 04:27:37 +00:00
|
|
|
https://github.com/pirate/ArchiveBox/wiki
|
2019-04-11 10:59:14 +00:00
|
|
|
'''.format(COMMANDS_HELP_TEXT, **ANSI))
|
2019-04-03 04:27:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|