-
Notifications
You must be signed in to change notification settings - Fork 35
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 an option to control recursive search & parsing of source files. #69
Comments
An additional argument to have
Otherwise, you need to add another flag |
Of course, in the command-line |
I also like the idea of having a non-recursive option. I lean toward thinking the current (recursive) behavior should be the default...but would be OK with it either way. |
I think the we could name the variable "onlyin", it is semantically clearer and does not take a position regarding how deep down the hierarchy you go. I side with @szaghi on the issue of defaults, and as far as I can see this is largely an argument about personal preferences. The reference to the default behaviour of the core file manipulation programs of unix is not very relevant because FoBiS is not a program dedicated to interacting with the file system but rather to abstract away the details of the file system. |
@Tobychev |
My suggestion was to rename |
Ok, I was assuming that having an --only parameter implied that the search would become non-recursive (and therefore was an alternative suggestion to have both --directories (or any name) and --recursive). This is a matter of preference indeed. Personally, I find --directories more explicit, but maybe the opinion of a native English speaker would be more useful. By the way, I realize there is already a |
Dear All, I am sorry of my huge delay, I am very busy. I see the points of all of you and I greatly appreciate your help, thank you very much! I am going to implement these features... however, I will start with a low-profile approach. Firstly, I agree to add a non recursive mode, but I prefer to maintain the default behavior to be recursive: I think a lot on the points of @perrette and I agree on almost all of them (I like to be more posix as possible...), however my soul go to Fortran poor people like me. We (I hope) appreciate to lunch simply a build to have all programs compiled and requiring to lunch build -r will break some of the magic I love of FoBiS. Therefore, the first step I am going to do is to a switch to disable the recursive search. After this we can talk about the mechanism to specify a pool of target. Besides, I decided to modify the --exclude switch in order to allow it to accept also directories (currently only files should be supported). Stay tuned! P.S. the doctests feature is here :-) |
In the v1.8.2 just uploaded I have added a new option: --disable_recursive_search/-drs that does what we said... the recursive search is disabled. The default behavior remains to be recursive. I have added a specific unit tests (built-test16) where it is proven that with this option only the first level programs are build, the recursion is disabled. No I will work on how to support directories/pool of targets. Your opinions on this new option are very appreciated. |
@perrette @jacobwilliams @Tobychev and all, I finally end up with this solution (quick and dirty):
All of these options (as well as the others) can be mixed. Therefore I think that many of your corners usages should be covered. For the @jacobwilliams issue#70 there is still a little step to do: with I am closing this issue and others, but feel free to replay with your critics and suggestions and I will reopen them if necessary. |
As we started to discuss in issue #61 , FoBiS.py could be made more robust by enhancing user control (without losing the automated features that make FoBiS.py attractive in the first place). An easy step would be to include a
directories=
parameter. For the cumbersome example of the README, it would look like:(this is for the fobos config file, but there would be an equivalent command-line parameter
--directories src src/nested-1 src/nested-1/nested-2
). This parameter would indicate FoBiS.py which directories to search for source files, in a non-recursive way.@szaghi suggested that, if the only effect of a
directories=
parameter would be to limit the recursive search to certain directories, the parameter could be namedonly=
. I think however this would be ambiguous, and an independent specification ofdirectories=
andrecursive=
is preferable. For example,recursive=True
anddirectories=["src1", "src2"]
is a perfectly valid use case, useful when only src1 and src2 sub-directories of the current location should be searched for and parsed (out of the possibly many directories present here (e.g. "obj", "src1-old", "other-project"), but still in a recursive way. On the other hand, the above cumbersome example withdirectories=
specification would be associated withrecursive=False
.I would make the further strong suggestion that FoBiS.py becomes non-recursive by default, unless an explicit
-r
or--recursive
flag is passed (recursive=True
in fobos), like most unix commands that actually process file contents (e.g. grep, cp, ctags). Adding a-r
is really a minor additional burden for the user, and is much more compatible with the unix command-line philosophy.As a summary:
-r
or--recursive
flag (equivalently, recursive = True in fobos file, by default, False)--recursive
or--directories
is specified, only files in the current folder are searched for or parsed (i.e. default isrecursive=False
anddirectories=["./"]
).fobos
config file would be to specifydirectories=
.The text was updated successfully, but these errors were encountered: