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

[dev.icinga.com #10243] Provide keywords to retrieve the current file name at parse time #3452

Closed
icinga-migration opened this issue Sep 29, 2015 · 7 comments
Labels
area/configuration DSL, parser, compiler, error handling enhancement New feature or request
Milestone

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/10243

Created by tgelf on 2015-09-29 14:04:50 +00:00

Assignee: gbeutner
Status: Resolved (closed on 2015-11-03 15:37:09 +00:00)
Target Version: 2.4.0
Last Update: 2015-11-12 15:34:39 +00:00 (in Redmine)

Backport?: No
Include in Changelog: 1

I'd suggest to provide a keyword allowing us to determine the current file name at parse time, like FILE does in Ruby or PHP. As keywords need to be lowercase a name like "current_filename" would probably be a better fit. This feature request starts to make sense combined with a new method called dirname(). What I want to achieve are config snippets looking as follows.

# in conf.d/commands.conf:
const StageDir = dirname(dirname(current_filename))

Cheers,
Thomas

Changesets

2015-11-03 15:34:34 +00:00 by (unknown) 51f473d

Implement the current_filename and current_line keywords

fixes #10243
@icinga-migration
Copy link
Author

Updated by tgelf on 2015-09-29 14:05:46 +00:00

NB: FILE should read

__FILE__

@icinga-migration
Copy link
Author

Updated by gbeutner on 2015-10-02 14:09:46 +00:00

Btw, we already have basename() and dirname():

<1> => dirname("/etc/icinga2")
"/etc"
<2> => basename("/etc/icinga2")
"icinga2"

@icinga-migration
Copy link
Author

Updated by tgelf on 2015-10-02 14:19:51 +00:00

  • Done % changed from 0 to 50

gunnarbeutner wrote:

Btw, we already have basename() and dirname():

Nice, so all I need is a keyword "current_filename" :-)

@icinga-migration
Copy link
Author

Updated by gbeutner on 2015-11-03 15:37:03 +00:00

  • Category set to Configuration
  • Status changed from New to Assigned
  • Assigned to set to gbeutner
  • Target Version set to 2.4.0

@icinga-migration
Copy link
Author

Updated by Anonymous on 2015-11-03 15:37:09 +00:00

  • Status changed from Assigned to Resolved
  • Done % changed from 50 to 100

Applied in changeset 51f473d.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-11-11 14:44:24 +00:00

  • Subject changed from Provide a method to retrieve current file name at parse time to Provide keywords to retrieve the current file name at parse time

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-11-12 15:34:39 +00:00

  • Backport? changed from TBD to No

@icinga-migration icinga-migration added enhancement New feature or request area/configuration DSL, parser, compiler, error handling labels Jan 17, 2017
@icinga-migration icinga-migration added this to the 2.4.0 milestone Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/configuration DSL, parser, compiler, error handling enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant