summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-04-30 04:41:15 +0200
committerhut <hut@lavabit.com>2010-04-30 04:41:15 +0200
commite924cf9916cfa8d176ae258814dd07c67c69be69 (patch)
tree9d02d94df6453121a7695b2d0f49c60302e798bf /ranger
parentf61895d31e9ef4871be93d91a0bc3dfd6a121cab (diff)
downloadranger-e924cf9916cfa8d176ae258814dd07c67c69be69.tar.gz
added help chapter 5, ranger/help/invocation.py
Diffstat (limited to 'ranger')
-rw-r--r--ranger/help/__init__.py3
-rw-r--r--ranger/help/index.py1
-rw-r--r--ranger/help/invocation.py106
3 files changed, 109 insertions, 1 deletions
diff --git a/ranger/help/__init__.py b/ranger/help/__init__.py
index 1a651d56..f304c7bc 100644
--- a/ranger/help/__init__.py
+++ b/ranger/help/__init__.py
@@ -24,7 +24,8 @@ NO_HELP = """No help was found.
 Possibly the program was invoked with "python -OO" which
 discards all documentation."""
 
-HELP_TOPICS = ('index', 'movement', 'starting', 'console', 'fileop')
+HELP_TOPICS = ('index', 'movement', 'starting', 'console', 'fileop',
+		'invocation')
 
 def get_docstring_of_module(path, module_name):
 	imported = __import__(path, fromlist=[module_name])
diff --git a/ranger/help/index.py b/ranger/help/index.py
index 794e3ea9..316e975f 100644
--- a/ranger/help/index.py
+++ b/ranger/help/index.py
@@ -26,6 +26,7 @@
 	|2?|	Running Files
 	|3?|	The console
 	|4?|	File operations
+	|5?|	Ranger invocation
 
 
 ==============================================================================
diff --git a/ranger/help/invocation.py b/ranger/help/invocation.py
new file mode 100644
index 00000000..3de574cc
--- /dev/null
+++ b/ranger/help/invocation.py
@@ -0,0 +1,106 @@
+# Copyright (C) 2009, 2010  Roman Zimbelmann <romanz@lavabit.com>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+"""
+5. Ranger invocation
+
+5.1. Command Line Arguments
+5.2. Python Options
+
+
+==============================================================================
+5.1. Command Line Arguments
+
+These options can be passed to ranger when starting it from the
+command line.
+
+--version
+      Print the version and exit.
+
+-h, --help
+      Print a list of options and exit.
+
+-d, --debug
+      Activate the debug mode:  Whenever an error occurs, ranger
+      will exit and print a full backtrace.  The default behaviour
+      is to merely print the name of the exception in the statusbar/log
+      and to try to keep running.
+
+-c, --clean
+      Activate the clean mode:  Ranger will not access or create any
+      configuration files nor will it leave any traces on your system.
+      This is useful when your configuration is broken, when you want
+      to avoid clutter, etc.
+
+--fail-if-run
+      Return the exit code 1 if ranger is used to run a file, for example
+      with `ranger --fail-if-run filename`.  This can be useful for scripts.
+
+-r <dir>, --confdir=<dir>
+      Define a different configuration directory.  The default is
+      $HOME/.ranger.
+
+-m <n>, --mode=<n>
+      When a filename is supplied, make it run in mode <n> |2|
+
+-f <flags>, --flags=<flags>
+      When a filename is supplied, run it with the flags <flags> |2|
+
+(Optional) Positional Argument
+      The positional argument should be a path to the directory you
+      want ranger to start in, or the file which you want to run.
+      Only one positional argument is accepted as of now.
+
+--
+      Stop looking for options.  All following arguments are treated as
+      positional arguments.
+
+Examples:
+      ranger episode1.avi
+      ranger --debug /usr/bin
+      ranger --confdir=~/.config/ranger --fail-if-run
+
+
+==============================================================================
+5.2. Python Options
+
+Ranger makes use of python optimize flags.  To use them, run ranger like this:
+      PYTHONOPTIMIZE=1 ranger
+An alternative is:
+      python -O `which ranger`
+Or you could change the first line of the ranger script and add -O/-OO.
+The first way is the recommended one.  Of course you can make an alias or
+a shell fuction to save typing.
+
+Using PYTHONOPTIMIZE=1 (-O) will make python discard assertion statements.
+Assertions are little pieces of code which are helpful for finding errors,
+but unless you're touching sensitive parts of ranger, you may want to
+disable them to save some computing power.
+
+Using PYTHONOPTIMIZE=2 (-OO) will additionally discard any docstrings.
+In ranger, most built-in documentation (F1/? keys) is implemented with
+docstrings.  Use this option if you don't need the documentation.
+
+Examples:
+      PYTHONOPTIMIZE=1 ranger episode1.avi
+      PYTHONOPTIMIZE=2 ranger --debug /usr/bin
+      python -OO `which ranger` --confdir=~/.config/ranger --fail-if-run
+
+Note: The author expected "-OO" to reduce the memory usage, but that
+doesn't seem to happen.
+
+
+==============================================================================
+"""
+# vim:tw=78:sw=8:sts=8:ts=8:ft=help
>394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863