aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2022-03-21 08:43:37 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2022-03-21 08:43:37 -0400
commitbf2450d2cf1dd2f5f45477c0c36d62c8d2dcd931 (patch)
treedd04d4fbdb149963a663afb51df120846a976fcd
parentdbdfb68893a5b9677a9286beff8de3c1b02fff5d (diff)
downloadfpoint-master.tar.gz
fpoint-master.zip
Added option to explicitly specify output fileHEADmaster
-rw-r--r--driver.f9027
-rw-r--r--fpoint.prj2
2 files changed, 23 insertions, 6 deletions
diff --git a/driver.f90 b/driver.f90
index 2521407..2dc6e8a 100644
--- a/driver.f90
+++ b/driver.f90
@@ -28,7 +28,7 @@ implicit none
logical::verbose
logical::notes
integer::i, j, retcode
- character(len=:), pointer::filename, arg
+ character(len=:), pointer::filename, arg, outname
if(command_argument_count() < 1) then
call usage()
@@ -39,7 +39,9 @@ implicit none
verbose = .false.
notes = .false.
filename => null()
- do i = 1, command_argument_count()
+ outname => null()
+ i = 1
+ do while(i <= command_argument_count())
call get_command_argument(i, length=j)
allocate(character(len=j)::arg)
@@ -51,6 +53,12 @@ implicit none
else if(arg == "-v") then
verbose = .true.
+ else if(arg == "-o") then
+ i = i + 1
+ call get_command_argument(i, length=j)
+ allocate(character(len=j)::outname)
+ call get_command_argument(i, value=outname)
+
else
filename => arg
arg => null()
@@ -62,6 +70,8 @@ implicit none
arg => null()
end if
+ i = i + 1
+
end do
if(verbose) then
@@ -76,7 +86,13 @@ implicit none
call presentation%parse()
if((.not. notes) .or. presentation%has_notes()) then
- write(*, '(A)') presentation%to_text(notes_only=notes)
+ if(associated(outname)) then
+ open(newunit=j, file=outname, action="write", status="unknown")
+ write(j, '(A)') presentation%to_text(notes_only=notes)
+ close(j)
+ else
+ write(*, '(A)') presentation%to_text(notes_only=notes)
+ end if
else
call maybe_print(verbose, "No slide notes found in "//filename)
retcode = 1
@@ -115,8 +131,9 @@ contains
Print *, " "
Print *, "Options:"
Print *, " "
- Print *, " -n Extract notes instead of slide contents"
- Print *, " -v Be somewhat verbose, probably not enough to be interesting"
+ Print *, " -o <filename> Write output to specified filename instead of console"
+ Print *, " -n Extract notes instead of slide contents"
+ Print *, " -v Be somewhat verbose, probably not enough to be interesting"
Print *, " "
Print *, "Output is printed to standard out"
Print *, " "
diff --git a/fpoint.prj b/fpoint.prj
index 038a8ed..f6dab7e 100644
--- a/fpoint.prj
+++ b/fpoint.prj
@@ -61,7 +61,7 @@
"Launch Using MPI":"false",
"Keep Console":"true",
"External Console":"true",
- "Command Line Arguments":"-n \"Welcome to PowerPoint.pptx\"",
+ "Command Line Arguments":"-n \"Welcome to PowerPoint.pptx\" -o temp.txt",
"Build Before Launch":"true"
},
"Build Options":{