summaryrefslogtreecommitdiffstats
path: root/fish/fish.c
Commit message (Collapse)AuthorAgeFilesLines
* Mac OS X: setlocale function requires <locale.h> header file.Richard Jones2010-03-221-0/+1
|
* Mac OS X: implement readline functions.Richard Jones2010-03-221-0/+4
| | | | | OS X has an older version of readline with some differences in the names of functions.
* Use mount-options instead of mount to avoid implicit -o sync.Richard Jones2010-02-101-4/+7
| | | | | | | | | | | | | | | guestfs_mount adds -o sync implicitly. This causes a very large performance problem for write-intensive programs (eg. virt-v2v). Document this as a "gotcha". Change the tests, guestfish, Sys::Guestfs::Lib, guestmount to use mount-options instead. (Note that this gotcha does not affect mount-ro). The source of the performance problem was first identified by Matthew Booth.
* Set locale in C programs so l10n works (RHBZ#559962).Richard Jones2010-01-291-0/+4
| | | | | | | | | | | | | | | This commit adds the calls to setlocale &c to all of the current C programs. It also adds l10n support to hivexget and hivexml which lacked them previously. To test this, try: LANG=pa_IN.UTF-8 guestfish --cmd-help (You can only do this test after installing the package, or at least the 'pa.mo' mo-file in the correct place).
* maint: use EXIT_SUCCESS and EXIT_FAILURE, not 0 and 1 in "usage", tooJim Meyering2009-11-201-2/+2
| | | | | | | | | | Convert by running these commands: perl -pi -e 's/\b(usage ?)\(1\)/$1(EXIT_FAILURE)/' \ fish/fish.c fuse/guestmount.c perl -pi -e 's/\b(usage ?)\(0\)/$1(EXIT_SUCCESS)/' \ fish/fish.c fuse/guestmount.c * fish/fish.c (main): Replace 0/1 with EXIT_SUCCESS/EXIT_FAILURE. * fuse/guestmount.c (main): Likewise.
* maint: use EXIT_SUCCESS and EXIT_FAILURE, not 0 and 1 to exitJim Meyering2009-11-201-37/+37
| | | | | | | | | | | | | | | Convert all uses automatically, via these two commands: git grep -l '\<exit *(1)' \ | grep -vEf .x-sc_prohibit_magic_number_exit \ | xargs --no-run-if-empty \ perl -pi -e 's/\b(exit ?)\(1\)/$1(EXIT_FAILURE)/' git grep -l '\<exit *(0)' \ | grep -vEf .x-sc_prohibit_magic_number_exit \ | xargs --no-run-if-empty \ perl -pi -e 's/\b(exit ?)\(0\)/$1(EXIT_SUCCESS)/' * .x-sc_prohibit_magic_number_exit: New file. Edit (RWMJ): Don't change Java code.
* fish: Improve output of guestfish -h cmdRichard Jones2009-11-171-1/+1
| | | | | | Display this output like a short manual page. Don't put <..> around the parameters to the command.
* change strncasecmp() == 0 to STRCASEEQLEN()Jim Meyering2009-11-091-1/+1
| | | | | git grep -l 'strncasecmp *([^=]*== *0'|xargs \ perl -pi -e 's/\bstrncasecmp( *\(.*?\)) *== *0\b/STRCASEEQLEN$1/g'
* change strncasecmp() == 0 to STRCASENEQLEN()Jim Meyering2009-11-091-1/+1
| | | | | git grep -l 'strncasecmp *([^=]*!= *0'|xargs \ perl -pi -e 's/\bstrncasecmp( *\(.*?\)) *!= *0\b/STRCASENEQLEN$1/g'
* use STREQ, not strcmp: part 2Jim Meyering2009-11-091-1/+1
| | | | | git grep -l 'strcmp *([^=]*!= *0'|xargs \ perl -pi -e 's/\bstrcmp( *\(.*?\)) *!= *0\b/STRNEQ$1/g'
* use STREQ, not strcmp: part 1Jim Meyering2009-11-091-4/+4
| | | | | git grep -l 'strcmp *([^=]*== *0'|xargs \ perl -pi -e 's/\bstrcmp( *\(.*?\)) *== *0/STREQ$1/g'
* convert strcasecmp(...) != 0 to STRCASENEQ(...)Jim Meyering2009-11-091-5/+5
| | | | | git grep -E -l 'strcasecmp *\(.*!= ?0\b'|xargs \ perl -pi -e 's/\bstrcasecmp( ?\(.*?\)) != 0/STRCASENEQ$1/g'
* convert uses of strcasecmp to STRCASEEQJim Meyering2009-11-091-34/+34
| | | | | git grep -l 'strcasecmp *([^=]*== *0'| xargs \ perl -pi -e 's/\bstrcasecmp( *\(.*?\)) *== *0/STRCASEEQ$1/'
* fish: Allow <nn>P and <nn>E for petabyte and exabyte allocations.Richard Jones2009-11-041-0/+4
|
* fish: Allow <nn>T for terabyte allocations.Richard Jones2009-11-041-0/+2
|
* fish: New command 'sparse', like 'alloc' but to generate sparse files.Richard Jones2009-11-041-0/+28
| | | | | | | | | | | | | | | | | With sparse you can make sparse files, which is fun because you can experiment with really large devices: ><fs> sparse /tmp/test.img 100G ><fs> run ><fs> sfdiskM /dev/vda , ><fs> mkfs ext2 /dev/vda1 # very long pause here ... ><fs> mount /dev/vda1 / To see the real (ie. allocated) size of the sparse file, use the du command, eg: ><fs> !du -h /tmp/test.img 1.6G -rw-rw-r-- 1 rjones rjones 100G 2009-11-04 17:40 /tmp/test.img
* guestfish: Add win: prefix to use Windows paths.Richard Jones2009-10-261-0/+48
| | | | | | | Add a win: prefix for path arguments in guestfish: ><fs> file win:c:\windows\system32\config\system.log MS Windows registry file, NT/2000 or above
* avoid use of all ctype macrosJim Meyering2009-09-241-3/+3
| | | | | | | | | | | | | | | | | | | | * cfg.mk (disable_temporarily): Don't disable sc_avoid_ctype_macros. * fish/tilde.c: Remove unnecessary inclusion of ctype.h. * bootstrap: Add gnulib's c-ctype module to the list. * daemon/m4/gnulib-cache.m4: Likewise. * daemon/ext2.c: Include "c-ctype.h", not <ctype.h>. Use c_isspace, etc, rather than isspace. * daemon/guestfsd.c: Likewise. * daemon/lvm.c: Likewise. * daemon/proto.c: Likewise. * fish/fish.c: Likewise. * fish/tilde.c: Likewise. * src/generator.ml: Likewise. * src/guestfs.c: Likewise. * examples/to-xml.c: Likewise. * examples/Makefile.am (to_xml_CPPFLAGS): Add -I$(top_srcdir)/gnulib/lib so inclusion of "c-ctype.h" works. (to_xml_CPPFLAGS): Rename from to_xml_CFLAGS.
* Remove guestfs_wait_ready (turn it into a no-op).Richard Jones2009-09-211-2/+0
| | | | | | | | | | | | | | This commit changes guestfs_launch so that it both launches the appliance and waits until it is ready (ie. the daemon communicates back to us). Since we removed the pretence that we could implement a low-level asynchronous API, the need to call launch() followed by wait_ready() has looked a bit silly. Now guestfs_wait_ready() is basically a no-op. It is left in the API for backwards compatibility. Any calls to guestfs_wait_ready() can be removed from client code.
* Move decl out for C99 compliance.Richard Jones2009-09-141-1/+3
|
* guestfish: Enable grouping in string listsMatthew Booth2009-09-141-17/+133
| | | | | | | | | | | | | | | | | | | | | | This change adds the ability to group entries in a string list with single quotes. So the string: "'foo bar'" becomes 1 token rather than 2. Consequently single quotes must now be escaped: "\'" resolves to a literal single quote. Incidentally, this change also alters another, probably unintentional behaviour of the previous implementation, in that tokens are separated by any amount of whitespace rather than a single whitespace character. I.e.: "a b" resolves to: 'a' 'b' rather than: 'a' '' 'b' That last syntax can be used if an empty argument is still desired. Whitespace is now also defined to include tabs. parse_string_list can also now fail if it contains an unmatched open quote.
* build: don't define _GNU_SOURCE manuallyJim Meyering2009-08-241-2/+0
| | | | | | | | | | | | Now that we're using gnulib in earnest, any manual definition would provoke a redefinition warning. * fish/fish.c (_GNU_SOURCE): Don't define. * fish/destpaths.c (_GNU_SOURCE): Likewise. * src/guestfs.c (_GNU_SOURCE): Likewise. * bootstrap (modules): Add asprintf, strchrnul, strerror, strndup and vasprintf. * fish/fish.c (main): Set argv[0] to sanitized program_name, so functions like getopt_long that use argv[0] use the clean name.
* guestfish: diagnose stdout write failureJim Meyering2009-08-241-0/+3
| | | | | | | | Use gnulib's closeout module to ensure any failure to write to stdout is detected and reported. * fish/fish.c: Include "closeout.h". (main): Call atexit (close_stdout); * bootstrap (modules): Add closeout.
* guestfish: don't try to diagnose getopt failureJim Meyering2009-08-241-2/+0
| | | | | * fish/fish.c: ... getopt_long already does that. Instead, suggest "Try `guestfish --help' for more information."
* guestfish: write --help to stdout, use gnulib's progname moduleJim Meyering2009-08-241-44/+90
| | | | | | | | | | * fish/fish.c: Include "progname.h". (main): Call set_program_name to initialize. Don't hard-code guestfish everywhere. Use program_name. However, be careful when modifying argv[0], since it is used in the hopes that it is an absolute file name. (usage): Don't spew all of --help for a mis-typed option. Split long lines.
* fish.c: don't perform arithmetic on void* pointersJim Meyering2009-08-211-1/+2
| | | | * fish/fish.c (xwrite): Use char*.
* fish.c: avoid signed/unsigned-comparison warningJim Meyering2009-08-211-2/+2
| | | | * fish/fish.c (script): Change type of index to "unsigned int".
* fish.c: avoid "assignment discards qualifiers..." warningJim Meyering2009-08-211-1/+1
| | | | | * fish/fish.c (main): Cast-away-const. * fish/fish.h (bad_cast): Define. Safer than using an actual cast.
* guestfish: detect more failed syscallsJim Meyering2009-08-191-8/+33
| | | | * fish/fish.c (issue_command): Detect/diagnose more failed syscalls.
* adjust const "**" pointers to avoid warningsJim Meyering2009-08-171-3/+3
| | | | | | Also, ... * src/generator.ml: Add DeviceList type, and propagate that change out to all calling/interface code.
* guestfish: Add --selinux option.Richard Jones2009-08-131-2/+7
|
* Convert all TABs-as-indentation to spaces.Jim Meyering2009-08-031-230/+230
| | | | | | | | | | | Do it by running this command: [exempted files are matched via .x-sc_TAB_in_indentation] git ls-files \ | pcregrep -vf .x-sc_TAB_in_indentation \ | xargs pcregrep -l '^ *\t' \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
* build: reenable "syntax-check" rule: sc_const_long_optionJim Meyering2009-08-031-1/+1
| | | | | | | * cfg.mk (disable_temporarily): Remove sc_const_long_option. * daemon/guestfsd.c (main): Declare long_options to be "const". * fish/fish.c (main): Likewise. * test-tool/test-tool.c (main): Likewise.
* guestfish: Make more strings translatable.Richard Jones2009-07-291-5/+3
| | | | | However this doesn't yet attempt to translate the POD command documentation. We need a plan to do that.
* guestfish -iv should print virt-inspector command (for debugging).Richard W.M. Jones2009-07-241-1/+3
|
* guestfish: Add tilde expansion for paths (RHBZ#511372).Richard Jones2009-07-151-1/+13
| | | | | | | | | | | | | | | | | | | This commit adds tilde expansion for local users in guestfish: ><fs> echo "~" ~ ><fs> echo ~ /home/rjones ><fs> echo ~foo ~foo ><fs> echo ~rjones/bar /home/rjones/bar ><fs> echo ~roo ~roo ><fs> echo ~root/foo /root/foo ><fs> echo ~root /root
* Guestfish feature: remote control of guestfish over a pipe.Richard Jones2009-07-141-6/+62
| | | | | | | | | | | | | | | | | The use case is to have a long-running guestfish process in a shell script, and thus to avoid the overhead of starting guestfish each time. Do: eval `guestfish --listen` guestfish --remote somecmd guestfish --remote someothercmd guestfish --remote exit This patch also supports having multiple guestfish processes at the same time. The protocol is simple XDR messages over a Unix domain socket.
* Guestfish: implement -x option, echo commands before executing them.Richard W.M. Jones2009-07-111-2/+15
|
* Fix: '-D' was not recognized as a parameter to guestfish.Richard W.M. Jones2009-07-111-1/+1
|
* Guestfish: Add 'reopen' command to reopen the libguestfs handle.Richard W.M. Jones2009-07-111-4/+15
|
* Add missing documentation for "more" command in guestfish help output.Richard W.M. Jones2009-07-111-0/+2
|
* guestfish: Always fflush stdout between commands.Richard Jones2009-07-061-1/+5
|
* remove trailing blanksJim Meyering2009-07-031-1/+1
|
* Add the guestfish 'time' command.Richard W.M. Jones2009-07-021-0/+10
| | | | | ><fs> time sfdisk /dev/sda 0 0 0 , elapsed time: 6.12 seconds
* Implement "more" and "less" commands in guestfish.Richard W.M. Jones2009-06-291-0/+36
| | | | | | | | Use commands such as: more /etc/passwd less /etc/fstab These commands are specific to guestfish.
* Guestfish pipes.Richard W.M. Jones2009-06-281-15/+71
|
* Quote command line arguments to virt-inspector.Richard W.M. Jones2009-06-241-1/+2
|
* Added guestfish -i option to run virt-inspector.Richard W.M. Jones2009-06-241-2/+58
| | | | | | You can invoke guestfish with: guestfish -i libvirt-domain guestfish -i disk-image(s)
* Implement guestfish -f option to allow guestfish scripts.Richard W.M. Jones2009-06-241-2/+21
| | | | | New '-f' option allows scripts to be written using: #!/usr/bin/guestfish -f
* Add 'glob' command for guestfish.Richard Jones2009-06-221-2/+12
|