@@ -19,8 +19,41 @@ DO_INTERACTIVE=0
19
19
BLOBS=()
20
20
FILENAMES=()
21
21
22
+ function print_usage {
23
+ echo " usage: $PROGNAME [-a] [-i] [--full] [<id> [-f <filename>] ...]"
24
+ }
25
+
26
+ function show_help {
27
+ print_usage
28
+
29
+ echo " "
30
+ echo " Recover deleted files in your git repository"
31
+ echo " "
32
+ echo " Options:"
33
+ echo " -a, --all Write all orphaned blobs to the current working"
34
+ echo " directory. Each file will be named using its 40"
35
+ echo " character object ID."
36
+ echo " -i, --interactive Display information about each orphaned blob and then"
37
+ echo " prompt to recover it."
38
+ echo " --full List or recover all orphaned blobs, even those that"
39
+ echo " are in packfiles. By default, git-recover will only"
40
+ echo " look at loose object files, which limits it to the"
41
+ echo " most recently created files. Examining packfiles may"
42
+ echo " be slow, especially in large repositories."
43
+ echo " <id> The object ID (or its abbreviation) to recover. The"
44
+ echo " file will be written to the current working directory"
45
+ echo " and named using its 40 character object ID, unless the"
46
+ echo " -f option is specified."
47
+ echo " -f, --filename name When specified after an object ID, the file written"
48
+ echo " will use this filename. In addition, any filters"
49
+ echo " (for example: CRLF conversion or Git-LFS) will be run"
50
+ echo " according to the gitattributes configuration."
51
+
52
+ exit 0
53
+ }
54
+
22
55
function die_usage {
23
- echo " usage: $PROGNAME [-a] [-i] [--full] [<id> [-f <filename>] ...] " >&2
56
+ print_usage >&2
24
57
exit 1
25
58
}
26
59
@@ -35,6 +68,9 @@ while [[ $# -gt 0 ]]; do
35
68
--full)
36
69
DO_FULL=1
37
70
;;
71
+ -h|--help)
72
+ show_help
73
+ ;;
38
74
* )
39
75
if [ " ${1: 0: 1} " == " -" ]; then
40
76
echo " $PROGNAME : unknown argument: $1 " >&2
0 commit comments