Bug #323
closedaqbanking-cli: No command line option to query the configuration directory
Description
In a ticket reported for the kmymoney application, a user did not know where to find the configuration directory for aqbanking. Since there is currently no command line option for this in aqbanking-cli, this commit adds a corresponding option --listconfdir.
This commit is preceded by a cleanup of the management of arguments in command line tools to avoid additional code duplication.
Files
Updated by rhabacker about 2 months ago
This request is related to ticket https://bugs.kde.org/show_bug.cgi?id=512032 in the KMyMoney bug tracker.
Updated by martin about 2 months ago
- Status changed from New to Feedback
Two thoughts:
- why would a user need to use a command line tool to find the settings folder?`It's always "$HOME/.aqbanking"?
- I would rather not add the args code to the library (that would make it part of the API which I don't find appropriate since these functions are only used inside the aqbanking tools). Maybe a conveniance lib should be build for that to be linked against by the aqbanking tools?
Updated by martin about 2 months ago
Hi,
martin schrieb (#note-2):
Two thoughts:
- why would a user need to use a command line tool to find the settings folder?`It's always "$HOME/.aqbanking"?
Ah, okay, I see now, it's Windows.
Updated by rhabacker about 2 months ago
- File 0001-In-command-line-tools-merge-common-stuff-for-argumen.patch added
- File 0002-aqbanking-cli-Add-command-listconfdir-to-show-the-pa.patch added
Maybe a conveniance lib should be build for that to be linked against by the aqbanking tools?
- This was added with the name libaqcli.
- Updated patches
Note: Let's take a look at the new function
int listConfDir(AB_BANKING *ab, GWEN_DB_NODE *dbArgs, int argc, char **argv)
{
const GWEN_ARGS args[]= {
{
GWEN_ARGS_FLAGS_HELP | GWEN_ARGS_FLAGS_LAST, /* flags */
GWEN_ArgsType_Int, /* type */
“help”, /* name */
0, /* minnum */
0, /* maxnum */
“h”, /* short option */
“help”, /* long option */
“Show this help screen”, /* short description */
“Show this help screen” /* long description */
}
};
There is another possible improvement, namely to move this entry, which is contained in every command, to a macro, for example AB_CMD_HELP_ENTRY, and use this:
const GWEN_ARGS args[]= {
AB_CMD_HELP_ENTRY
};Updated by martin about 2 months ago
Hi, thanks for the change.
I know it's outrageous of me to ask, but: Could the first patch be divided into one that adds the library and another which makes use of it?
The reason is that I'm using gwenbuild in my daily workflow with aqbanking and there are no changes in your patch for the 0BUILD files.
I can't apply the first patch directly because then I wouldn't be able to continue to work with gwenbuild unless I immediately created and adapted the 0BUILD files myself (and ATM I'd like to continue working in the workflow which works best for me, busy times now with CAMT, VOP and stuff).
Splitting that patch would allow me to first add the lib and then create and adapt the 0BUILD files later myself.
Regards
Martin
Updated by martin about 2 months ago
rhabacker schrieb (#note-4):
[...]
There is another possible improvement, namely to move this entry, which is contained in every command, to a macro, for example AB_CMD_HELP_ENTRY, and use this:
const GWEN_ARGS args[]= {
AB_CMD_HELP_ENTRY
};
[...]
Please don't move this just yet, as I started changing the way those arrays are created (see https://www.aquamaniac.de/rdm/projects/aqbanking/repository/aqbanking/revisions/master/entry/src/libs/plugins/backends/aqhbci/control/getaccsepa.c). That's how I define those arrays in one of my other larger projects and it makes them quite readable and short.
Regards
Martin
Updated by rhabacker about 2 months ago
- File 0001-Add-convenience-library-for-command-line-tools-named.patch added
- File 0002-In-command-line-tools-use-functions-from-libaqcli-to.patch added
- File 0003-aqbanking-cli-Add-command-listconfdir-to-show-the-pa.patch added
- File deleted (
0001-In-command-line-tools-merge-common-stuff-for-argumen.patch) - File deleted (
0002-aqbanking-cli-Add-command-listconfdir-to-show-the-pa.patch) - File deleted (
0001-In-command-line-tools-merge-common-stuff-for-argumen.patch) - File deleted (
0002-aqbanking-cli-Add-command-listconfdir-to-show-the-pa.patch)
- Split patches to add libaqcli first
Updated by rhabacker about 2 months ago
martin schrieb (#note-5):
The reason is that I'm using gwenbuild in my daily workflow with aqbanking and there are no changes in your patch for the 0BUILD files.
Here is an attempt to add such a file:
<?xml?>
<gwbuild>
<target type="ConvenienceLibrary" name="aqcli" >
<includes type="c" >
$(gwenhywfar_cflags)
-I$(topsrcdir)/src/libs
</includes>
<includes type="tm2" >
</includes>
<define name="BUILDING_AQBANKING" />
<define name="AQBANKING_SYSCONF_DIR" value="$(aqbanking_cfg_searchdir)" quoted="TRUE" />
<setVar name="local/cflags">$(visibility_cflags)</setVar>
<setVar name="tm2flags" >
</setVar>
<setVar name="local/typefiles" >
</setVar>
<setVar name="local/built_sources" >
</setVar>
<setVar name="local/built_headers_pub">
</setVar>
<setVar name="local/built_headers_priv" >
</setVar>
<headers dist="true" >
$(local/built_headers_pub)
cli.h
</headers>
<sources>
$(local/typefiles)
cli.c
</sources>
<useTargets>
</useTargets>
<subdirs>
</subdirs>
<extradist>
</extradist>
</target>
but unfortunally with or without that file gwbuild was not able to build aqbanking, see https://www.aquamaniac.de/rdm/issues/326.
Updated by martin about 2 months ago
- Status changed from Feedback to In Progress
Okay, thanks, I will incorporate your patches this week.
Regards
Martin
Updated by martin about 2 months ago
- Status changed from In Progress to Resolved
Okay, applied to master branch (with minor changes and additions).
Thanks!!!
Martin
Updated by rhabacker about 2 months ago
It appears that https://www.aquamaniac.de/rdm/attachments/615 has not been applied.
$ cd ~/src/aqbanking $ grep -rn listConfDir src/tools/aqbanking-cli/globals.h:146:int listConfDir(AB_BANKING *ab, GWEN_DB_NODE *dbArgs, int argc, char **argv);
Updated by rhabacker about 2 months ago
ahruesing@gmx.de reported an issue when running
make distclean && make -f Makefile.cvs && ./configure --host=x86_64-w64-mingw32 --prefix=/mingw64 && make typedefs && make typefiles && make -j12 && make install && date
which is fixed by applying the appended patch
Updated by rhabacker about 2 months ago
- File deleted (
0001-Add-convenience-library-for-command-line-tools-named.patch) - File deleted (
0002-In-command-line-tools-use-functions-from-libaqcli-to.patch)
Updated by rhabacker about 2 months ago
- File 0003-aqbanking-cli-Add-command-listconfdir-to-show-the-pa.patch 0003-aqbanking-cli-Add-command-listconfdir-to-show-the-pa.patch added
- File deleted (
0003-aqbanking-cli-Add-command-listconfdir-to-show-the-pa.patch)
Rebased patch
Updated by martin about 2 months ago
rhabacker schrieb (#note-12):
It appears that https://www.aquamaniac.de/rdm/attachments/615 has not been applied.
[...]
You're right. The patch didn't apply cleanly, so I aborted it (I didn't have the time to work out what the problem was).
Regards
Martin
Updated by martin about 2 months ago
Okay, both remaining patches now applied to git. Thank you very much!
Regards,
Martin