Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mv feature. Some more error checking has to be done in the glfs-m… #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ install-exec-local:
$(LN_S) -f gfcli $(DESTDIR)$(bindir)/gfrm
$(LN_S) -f gfcli $(DESTDIR)$(bindir)/gfstat
$(LN_S) -f gfcli $(DESTDIR)$(bindir)/gftail
$(LN_S) -f gfcli $(DESTDIR)$(bindir)/gfmv

rpms: prep
QA_RPATHS=17 rpmbuild --define '_topdir $(abs_top_builddir)/build/rpmbuild' \
Expand All @@ -25,7 +26,7 @@ prep: dist
cp glusterfs-coreutils.spec build/rpmbuild/SPECS

uninstall-local:
cd $(DESTDIR)$(bindir) && rm -f gfcat gfcp gfls gfmkdir gfmv gfrm gfstat gftail
cd $(DESTDIR)$(bindir) && rm -f gfcat gfcp gfls gfmkdir gfmv gfrm gfstat gftail gftouch

clean-local:
rm -rf build rpmbuild *.rpm
Expand Down
9 changes: 7 additions & 2 deletions man/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ gftail.1: $(top_builddir)/build/bin/gftail
$(HELP2MAN) --output=$@-t -I common_seealso.h2m \
$(top_builddir)/build/bin/$* && mv $@-t $@

gfmv.1: $(top_builddir)/build/bin/gfmv
$(HELP2MAN) --output=$@-t -I common_seealso.h2m \
$(top_builddir)/build/bin/$* && mv $@-t $@


man1_MANS = gfcat.1 \
gfcli.1 \
gfcp.1 \
Expand All @@ -47,8 +52,8 @@ man1_MANS = gfcat.1 \
gfput.1 \
gfrm.1 \
gfstat.1 \
gftail.1

gftail.1 \
gfmv.1
EXTRA_DIST = common_seealso.h2m

$(man1_MANS): $(srcdir)/common_seealso.h2m
Expand Down
8 changes: 6 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ all-local:
$(LN_S) -f gfcli $(top_builddir)/build/bin/gfrm
$(LN_S) -f gfcli $(top_builddir)/build/bin/gfstat
$(LN_S) -f gfcli $(top_builddir)/build/bin/gftail
$(LN_S) -f gfcli $(top_builddir)/build/bin/gfmv


bin_PROGRAMS = $(top_builddir)/build/bin/gfcli \
$(top_builddir)/build/bin/gfput
Expand All @@ -24,7 +26,8 @@ EXTRA_DIST = glfs-cat.h \
glfs-stat.h \
glfs-stat-util.h \
glfs-tail.h \
glfs-util.h
glfs-util.h \
glfs-mv.h

__top_builddir__build_bin_gfcli_SOURCES = glfs-cli.c \
glfs-cli-commands.c \
Expand All @@ -37,7 +40,8 @@ __top_builddir__build_bin_gfcli_SOURCES = glfs-cli.c \
glfs-stat.c \
glfs-stat-util.c \
glfs-tail.c \
glfs-util.c
glfs-util.c \
glfs-mv.c

__top_builddir__build_bin_gfcli_CFLAGS = $(GLFS_CFLAGS)
__top_builddir__build_bin_gfcli_LDADD = $(LDADD) $(GLFS_LIBS) -lreadline
Expand Down
8 changes: 5 additions & 3 deletions src/glfs-cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "glfs-stat.h"
#include "glfs-tail.h"
#include "glfs-util.h"
#include "glfs-mv.h"

#define AUTHORS "Written by Craig Cabrey."

Expand Down Expand Up @@ -73,7 +74,8 @@ shell_usage ()
"* rm\n"
"* stat\n"
"* tail\n"
"* flock\n");
"* flock\n"
"* mv\n");

return 0;
}
Expand All @@ -88,12 +90,12 @@ static struct cmd const cmds[] =
{ .name = "help", .execute = shell_usage },
{ .alias = "gfls", .name = "ls", .execute = do_ls },
{ .alias = "gfmkdir", .name = "mkdir", .execute = do_mkdir },
{ .alias = "gfmv", .name = "mv", .execute = not_implemented },
{ .name = "quit", .execute = handle_quit },
{ .alias = "gfrm", .name = "rm", .execute = do_rm },
{ .alias = "gfstat", .name = "stat", .execute = do_stat },
{ .alias = "gftail", .name = "tail", .execute = do_tail },
{ .name = "flock", .execute = do_flock }
{ .name = "flock", .execute = do_flock },
{ .alias = "gfmv", .name = "mv", .execute = do_mv }
};

static const struct cmd*
Expand Down
Loading